Part Number Hot Search : 
32024 A02020 2SC5201 82P33724 MA3G762 TLP3083F BR103 8206BA4
Product Description
Full Text Search
 

To Download HD6417604 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  regarding the change of names mentioned in the document, such as hitachi electric and hitachi xx, to renesas technology corp. the semiconductor operations of mitsubishi electric and hitachi were transferred to renesas technology corporation on april 1st 2003. these operations include microcomputer, logic, analog and discrete devices, and memory chips other than drams (flash memory, srams etc.) accordingly, although hitachi, hitachi, ltd., hitachi semiconductors, and other hitachi brand names are mentioned in the document, these names have in fact all been changed to renesas technology corp. thank you for your understanding. except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. renesas technology home page: http://www.renesas.com renesas technology corp. customer support dept. april 1, 2003 to all our customers .com .com .com 4 .com u datasheet
cautions keep safety first in your circuit designs! 1. renesas technology corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. notes regarding these materials 1. these materials are intended as a reference to assist our customers in the selection of the renesas technology corporation product best suited to the customer's application; they do not convey any license under any intellectual property rights, or an y other rights, belonging to renesas technology corporation or a third party. 2. renesas technology corporation assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained i n these materials. 3. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by renesas technology corporation without notice due to product improvements or other reasons. it is therefore recommended that customers contact renesas technology corporation or an authorized renesas technology corporation product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. renesas technology corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by renesas technology corporation by various means, including the renesas technology corporation semiconductor home page (http://www.renesas.com). 4. when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, an d algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. renesas technology corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. renesas technology corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact renesas technology corporation or an authorized renesas technology corporation product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. the prior written approval of renesas technology corporation is necessary to reprint or reproduce in whole or in part these materials. 7. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a lice nse from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. 8. please contact renesas technology corporation for further details on these materials or the products contained therein. .com .com .com .com 4 .com u datasheet
sh7604 hardware manual ade-602-085c rev. 4.0 3/5/03 hitachi, ltd. .com .com .com .com 4 .com u datasheet
cautions 1. hitachi neither warrants nor grants licenses of any rights of hitachi? or any third party? patent, copyright, trademark, or other intellectual property rights for information contained in this document. hitachi bears no responsibility for problems that may arise with third party? rights, including intellectual property rights, in connection with use of the information contained in this document. 2. products and product specifications may be subject to change without notice. confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. hitachi makes every attempt to ensure that its products are of high quality and reliability. however, contact hitachi? sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. design your application so that the product is used within the ranges guaranteed by hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail-safes, so that the equipment incorporating hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the hitachi product. 5. this product is not designed to be radiation resistant. 6. no one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from hitachi. 7. contact hitachi? sales office for any questions regarding this document or hitachi semiconductor products. .com .com .com .com 4 .com u datasheet
preface the sh7604 implements high-performance operations by using a cpu which employs the reduced instruction set computer (risc) system. the sh7604 is a new-generation risc microcomputer which realizes low power consumption, an essential feature of microcomputer devices, as well as integrating peripheral features necessary for system configuration. the cpu of the sh7604 has a set of risc-type instructions; basic instructions operate at one state per instruction, that is, in one system clock cycle, dramatically increasing execution speeds. the sh7604 incorporates a 32-bit multiplier which performs high-speed sum-of-product (multiply- and-accumulate) operations. instructions used by the sh7604 are upwardly compatible with the sh7000 series, allowing easy migration from the sh7000 series to the sh7604. moreover, the sh7604 incorporates on-chip peripheral modules such as an interrupt controller (intc), direct memory access controller (dmac), division unit (divu), timers (frt, wdt), and serial communication interface (sci), so that a user system can be configured using the minimum number of parts. on-chip cache memory enhances the cpu throughput. a bus control feature, which supports external memory access, improves external memory access efficiency, allowing direct connection to synchronous dram, dram, and pseudo-sram without the help of glue logic. this hardware manual explains the hardware features of the sh7604. for details of instructions, see the programming manual. related documents sh7604 instructions ?h-1/sh-2 programming manual?(document no.: ade-602-063b) for the development environment system, call your nearest hitachi sales office. .com .com .com .com 4 .com u datasheet
.com .com .com .com 4 .com u datasheet
list of items revised or added for this version section page item description (see manual for details) 1.1.1 features of the sh7604 2 operation modes description of clock mode added 4 package 176-pin plastic tfbga (tbp-176) added 1.3.1 pin arrangement 5 product lineup added 8 figure 1.3 pin arrangement (176-pin plastic tfbga) added 1.3.2 pin functions 9 table 1.1 pin functions pin no. (tbp-176) added 3.2.2 clock operating mode setting 51 description added 52 table 3.3 clock mode pin settings and states note 3 added 3.2.7 notes on board design 61 when using pll oscillation circuits description replaced 62 figure 3.9 design consideration when using pll oscillation circuits figure amended, additional description of figure appendix c external dimensions 616 figure c.2 external dimensions (tbp-176) added .com .com .com .com 4 .com u datasheet
.com .com .com .com 4 .com u datasheet
i contents section 1 overview and pin functions ....................................................................... 1 1.1 sh7604 features............................................................................................................. ... 1 1.1.1 features of the sh7604 ........................................................................................ 1 1.2 block diagram............................................................................................................... .... 6 1.3 description of pins ......................................................................................................... ... 7 1.3.1 pin arrangement .................................................................................................. 7 1.3.2 pin functions........................................................................................................ 9 section 2 cpu ..................................................................................................................... 15 2.1 register configuration ...................................................................................................... 15 2.1.1 general registers.................................................................................................. 15 2.1.2 control registers.................................................................................................. 16 2.1.3 system registers .................................................................................................. 17 2.1.4 initial values of registers .................................................................................... 17 2.2 data formats................................................................................................................ ...... 18 2.2.1 data format in registers...................................................................................... 18 2.2.2 data format in memory ....................................................................................... 18 2.2.3 immediate data format........................................................................................ 19 2.3 instruction features ........................................................................................................ ... 19 2.3.1 risc-type instruction set ................................................................................... 19 2.3.2 addressing modes................................................................................................ 22 2.3.3 instruction formats .............................................................................................. 25 2.4 instruction set............................................................................................................. ....... 29 2.4.1 instruction set by classification .......................................................................... 29 2.4.2 operation code map ............................................................................................ 42 2.5 processing states ........................................................................................................... .... 44 2.5.1 state transitions ................................................................................................... 44 2.5.2 power-down state................................................................................................ 46 section 3 oscillator circuits and operating modes ................................................ 49 3.1 overview.................................................................................................................... ........ 49 3.2 on-chip clock pulse generator and operating modes .................................................... 49 3.2.1 clock pulse generator.......................................................................................... 49 3.2.2 clock operating mode settings ........................................................................... 51 3.2.3 connecting a crystal resonator ........................................................................... 52 3.2.4 inputting an external clock.................................................................................. 54 3.2.5 selecting operating frequency with a register ................................................... 54 3.2.6 operating modes and frequency ranges............................................................. 60 3.2.7 notes on board design ........................................................................................ 60 .com .com .com .com 4 .com u datasheet
ii 3.3 bus width of the cs0 area ............................................................................................... 62 3.4 switching between master mode and slave mode ........................................................... 63 section 4 exception handling ........................................................................................ 65 4.1 overview.................................................................................................................... ........ 65 4.1.1 types of exception handling and priority order ................................................ 65 4.1.2 exception handling operations ........................................................................... 66 4.1.3 exception vector table........................................................................................ 67 4.2 resets...................................................................................................................... ........... 69 4.2.1 types of resets .................................................................................................... 69 4.2.2 power-on reset.................................................................................................... 70 4.2.3 manual reset........................................................................................................ 70 4.3 address errors .............................................................................................................. ..... 71 4.3.1 sources of address errors.................................................................................... 71 4.3.2 address error exception handling ...................................................................... 72 4.4 interrupts.................................................................................................................. .......... 72 4.4.1 interrupt sources .................................................................................................. 72 4.4.2 interrupt priority levels ....................................................................................... 73 4.4.3 interrupt exception handling ............................................................................... 73 4.5 exceptions triggered by instructions................................................................................ 74 4.5.1 instruction-triggered exception types................................................................ 74 4.5.2 trap instructions .................................................................................................. 74 4.5.3 illegal slot instructions ........................................................................................ 74 4.5.4 general illegal instructions .................................................................................. 75 4.6 when exception sources are not accepted...................................................................... 75 4.6.1 immediately after a delayed branch instruction.................................................. 75 4.6.2 immediately after an interrupt-disabled instruction............................................ 76 4.7 stack status after exception handling .............................................................................. 76 4.8 usage notes ................................................................................................................. ...... 76 4.8.1 value of stack pointer (sp).................................................................................. 76 4.8.2 value of vector base register (vbr) ................................................................. 76 4.8.3 address errors caused by stacking of address error exception handling ........ 77 4.8.4 manual reset during register access.................................................................. 77 section 5 interrupt controller (intc) ......................................................................... 79 5.1 overview.................................................................................................................... ........ 79 5.1.1 features ................................................................................................................ 79 5.1.2 block diagram...................................................................................................... 79 5.1.3 pin configuration ................................................................................................. 81 5.1.4 register configuration ......................................................................................... 81 5.2 interrupt sources........................................................................................................... ..... 82 5.2.1 nmi interrupt ....................................................................................................... 82 5.2.2 user break interrupt ............................................................................................. 82 .com .com .com .com 4 .com u datasheet
iii 5.2.3 irl interrupts ....................................................................................................... 83 5.2.4 on-chip peripheral module interrupts.................................................................. 85 5.2.5 interrupt exception vectors and priority order ................................................... 86 5.3 description of registers .................................................................................................... 88 5.3.1 interrupt priority level setting register a (ipra) ............................................. 88 5.3.2 interrupt priority level setting register b (iprb).............................................. 89 5.3.3 vector number setting register wdt (vcrwdt) ........................................... 91 5.3.4 vector number setting register a (vcra)........................................................ 91 5.3.5 vector number setting register b (vcrb) ........................................................ 92 5.3.6 vector number setting register c (vcrc) ........................................................ 93 5.3.7 vector number setting register d (vcrd)........................................................ 94 5.3.8 interrupt control register (icr) .......................................................................... 95 5.4 interrupt operation ......................................................................................................... ... 97 5.4.1 interrupt sequence................................................................................................ 97 5.4.2 stack after interrupt exception handling............................................................. 99 5.5 interrupt response time.................................................................................................... 1 00 5.6 sampling of pins irl3 irl0 ............................................................................................ 101 5.7 usage notes ................................................................................................................. ...... 103 section 6 user break controller ................................................................................... 107 6.1 overview.................................................................................................................... ........ 107 6.1.1 features ................................................................................................................ 10 7 6.1.2 block diagram...................................................................................................... 108 6.1.3 register configuration ......................................................................................... 109 6.2 register descriptions....................................................................................................... .. 110 6.2.1 break address register a (bara) ..................................................................... 110 6.2.2 break address mask register a (bamra)........................................................ 111 6.2.3 break bus cycle register a (bbra) .................................................................. 112 6.2.4 break address register b (barb)...................................................................... 114 6.2.5 break address mask register b (bamrb) ........................................................ 114 6.2.6 break data register b (bdrb) ........................................................................... 114 6.2.7 break data mask register b (bdmrb).............................................................. 115 6.2.8 bus break register b (bbrb) ............................................................................. 116 6.2.9 break control register (brcr) .......................................................................... 116 6.3 operation ................................................................................................................... ........ 120 6.3.1 flow of the user break operation........................................................................ 120 6.3.2 break on instruction fetch cycle ......................................................................... 120 6.3.3 break on data access cycle ................................................................................ 121 6.3.4 break on external bus cycle ............................................................................... 122 6.3.5 program counter (pc) values saved ................................................................... 122 6.3.6 example of use .................................................................................................... 123 6.3.7 usage notes.......................................................................................................... 126 6.3.8 sh7000 series compatible mode ........................................................................ 127 .com .com .com .com 4 .com u datasheet
iv section 7 bus state controller (bsc) ......................................................................... 129 7.1 overview.................................................................................................................... ........ 129 7.1.1 features ................................................................................................................ 12 9 7.1.2 block diagram...................................................................................................... 130 7.1.3 pin configuration ................................................................................................. 132 7.1.4 register configuration ......................................................................................... 134 7.1.5 address map ........................................................................................................ 134 7.2 description of registers .................................................................................................... 136 7.2.1 bus control register 1 (bcr1)............................................................................ 136 7.2.2 bus control register 2 (bcr2)............................................................................ 138 7.2.3 wait control register (wcr).............................................................................. 140 7.2.4 individual memory control register (mcr)....................................................... 142 7.2.5 refresh timer control/status register (rtcsr) ................................................ 146 7.2.6 refresh timer counter (rtcnt) ........................................................................ 147 7.2.7 refresh time constant register (rtcor).......................................................... 148 7.3 access size and data alignment ...................................................................................... 148 7.3.1 connection to ordinary devices .......................................................................... 148 7.3.2 connection to little-endian devices ................................................................... 150 7.4 accessing ordinary space................................................................................................. 151 7.4.1 basic timing ........................................................................................................ 151 7.4.2 wait state control ................................................................................................ 155 7.5 synchronous dram interface .......................................................................................... 157 7.5.1 synchronous dram direct connection.............................................................. 157 7.5.2 address multiplexing ........................................................................................... 159 7.5.3 burst reads .......................................................................................................... 160 7.5.4 single reads ......................................................................................................... 164 7.5.5 writes ................................................................................................................... 1 65 7.5.6 bank active function........................................................................................... 166 7.5.7 refreshes .............................................................................................................. 174 7.5.8 power-on sequence ............................................................................................. 177 7.5.9 phase shift by pll............................................................................................... 179 7.6 dram interface.............................................................................................................. .. 181 7.6.1 dram direct connection.................................................................................... 181 7.6.2 address multiplexing ........................................................................................... 183 7.6.3 basic timing ........................................................................................................ 184 7.6.4 wait state control ................................................................................................ 185 7.6.5 burst access ......................................................................................................... 186 7.6.6 refresh timing..................................................................................................... 188 7.6.7 power-on sequence ............................................................................................. 189 7.7 pseudo-sram interface.................................................................................................... 189 7.7.1 pseudo-sram direct connection........................................................................ 189 7.7.2 basic timing ........................................................................................................ 192 7.7.3 wait state control ................................................................................................ 193 .com .com .com .com 4 .com u datasheet
v 7.7.4 burst access ......................................................................................................... 194 7.7.5 refreshing ............................................................................................................ 195 7.7.6 power-on sequence ............................................................................................. 197 7.8 burst rom interface ......................................................................................................... 197 7.9 waits between access cycles ........................................................................................... 200 7.10 bus arbitration ............................................................................................................ ...... 201 7.10.1 master mode ........................................................................................................ 203 7.10.2 slave mode........................................................................................................... 205 7.10.3 partial-share master mode................................................................................... 206 7.10.4 external bus address monitor ............................................................................. 209 7.10.5 master/slave coordination................................................................................... 209 7.11 other topics ............................................................................................................... ....... 210 7.11.1 resets................................................................................................................... . 210 7.11.2 access as seen from the cpu or dmac............................................................. 210 7.11.3 emulator ............................................................................................................... 21 2 section 8 cache .................................................................................................................. 213 8.1 introduction................................................................................................................ ........ 213 8.2 cache control register (ccr).......................................................................................... 214 8.3 address space and the cache............................................................................................ 216 8.4 cache operation ............................................................................................................. ... 216 8.4.1 cache reads ......................................................................................................... 216 8.4.2 write access ........................................................................................................ 219 8.4.3 cache-through access ........................................................................................ 220 8.4.4 the tas instruction ............................................................................................. 221 8.4.5 pseudo-lru and cache replacement.................................................................. 222 8.4.6 cache initialization .............................................................................................. 224 8.4.7 associative purges................................................................................................ 224 8.4.8 data array access................................................................................................ 224 8.4.9 address array access .......................................................................................... 225 8.5 cache use................................................................................................................... ....... 226 8.5.1 initialization.......................................................................................................... 22 6 8.5.2 purge of specific lines ........................................................................................ 227 8.5.3 cache data coherency ......................................................................................... 227 8.5.4 two-way cache mode ........................................................................................ 228 8.5.5 usage notes.......................................................................................................... 229 section 9 direct memory access controller (dmac) .......................................... 231 9.1 overview.................................................................................................................... ........ 231 9.1.1 features ................................................................................................................ 23 1 9.1.2 block diagram...................................................................................................... 233 9.1.3 pin configuration ................................................................................................. 234 9.1.4 register configuration ......................................................................................... 234 .com .com .com .com 4 .com u datasheet
vi 9.2 register descriptions....................................................................................................... .. 235 9.2.1 dma source address registers 0 and 1 (sar0 and sar1)............................... 235 9.2.2 dma destination address registers 0 and 1 (dar0 and dar1) ...................... 236 9.2.3 dma transfer count registers 0 and 1 (tcr0 and tcr1)................................ 236 9.2.4 dma channel control registers 0 and 1 (chcr0 and chcr1) ....................... 237 9.2.5 dma vector number registers 0 and 1 (vcrdma0, vcrdma1) ................. 241 9.2.6 dma request/response selection control registers 0 and 1 (drcr0, drcr1)................................................................................................ 242 9.2.7 dma operation register (dmaor)................................................................... 243 9.3 operation ................................................................................................................... ........ 245 9.3.1 dma transfer flow ............................................................................................. 245 9.3.2 dma transfer requests....................................................................................... 247 9.3.3 channel priorities ................................................................................................. 249 9.3.4 dma transfer types ........................................................................................... 251 9.3.5 number of bus cycles.......................................................................................... 258 9.3.6 dma transfer request acknowledge signal output timing ............................. 258 9.3.7 dreq pin input detection timing ...................................................................... 268 9.3.8 dma transfer end............................................................................................... 283 9.4 examples of use............................................................................................................. ... 284 9.4.1 dma transfer between on-chip sci and external memory ............................. 284 9.5 usage notes ................................................................................................................. ...... 285 section 10 division unit .................................................................................................... 287 10.1 overview................................................................................................................... ......... 287 10.1.1 features ................................................................................................................ 2 87 10.1.2 block diagram...................................................................................................... 288 10.1.3 register configuration ......................................................................................... 288 10.2 description of registers ................................................................................................... . 289 10.2.1 divisor register (dvsr) ..................................................................................... 289 10.2.2 dividend register l for 32-bit division (dvdnt) ............................................ 289 10.2.3 division control register (dvcr)...................................................................... 290 10.2.4 vector number setting register div (vcrdiv) ............................................... 291 10.2.5 dividend register h (dvdnth) ........................................................................ 291 10.2.6 dividend register l (dvdntl) ......................................................................... 292 10.3 operation .................................................................................................................. ......... 292 10.3.1 64-bit 32-bit operations ................................................................................... 292 10.3.2 32-bit 32-bit operations ................................................................................... 292 10.3.3 handling of overflows ......................................................................................... 293 10.4 usage notes ................................................................................................................ ....... 293 10.4.1 access................................................................................................................... 293 10.4.2 overflow flag ...................................................................................................... 294 .com .com .com .com 4 .com u datasheet
vii section 11 16-bit free-running timer ......................................................................... 295 11.1 overview................................................................................................................... ......... 295 11.1.1 features ................................................................................................................ 2 95 11.1.2 block diagram...................................................................................................... 296 11.1.3 pin configuration ................................................................................................. 297 11.1.4 register configuration ......................................................................................... 297 11.2 register descriptions...................................................................................................... ... 298 11.2.1 free-running counter (frc)............................................................................... 298 11.2.2 output compare registers a and b (ocra and ocrb).................................... 298 11.2.3 input capture register (icr) ............................................................................... 299 11.2.4 timer interrupt enable register (tier) .............................................................. 299 11.2.5 free-running timer control/status register (ftcsr)....................................... 300 11.2.6 timer control register (tcr) ............................................................................. 302 11.2.7 timer output compare control register (tocr) .............................................. 303 11.3 cpu interface .............................................................................................................. ...... 304 11.4 operation .................................................................................................................. ......... 307 11.4.1 frc count timing ............................................................................................... 307 11.4.2 output timing for output compare..................................................................... 308 11.4.3 frc clear timing................................................................................................ 308 11.4.4 input capture input timing.................................................................................. 309 11.4.5 input capture flag (icf) setting timing............................................................. 310 11.4.6 output compare flag (ocfa, ocfb) setting timing ....................................... 310 11.4.7 timer overflow flag (ovf) setting timing ....................................................... 311 11.5 interrupt sources.......................................................................................................... ...... 312 11.6 example of frt use ......................................................................................................... 312 11.7 usage notes ................................................................................................................ ....... 313 section 12 watchdog timer (wdt) .............................................................................. 319 12.1 overview................................................................................................................... ......... 319 12.1.1 features ................................................................................................................ 3 19 12.1.2 block diagram...................................................................................................... 320 12.1.3 pin configuration ................................................................................................. 320 12.1.4 register configuration ......................................................................................... 321 12.2 register descriptions...................................................................................................... ... 321 12.2.1 watchdog timer counter (wtcnt) ................................................................... 321 12.2.2 watchdog timer control/status register (wtcsr)........................................... 322 12.2.3 reset control/status register (rstcsr) ............................................................ 323 12.2.4 register access .................................................................................................... 324 12.3 operation .................................................................................................................. ......... 326 12.3.1 operation in watchdog timer mode ................................................................... 326 12.3.2 operation in interval timer mode ....................................................................... 328 12.3.3 operation in standby mode.................................................................................. 328 12.3.4 timing of overflow flag (ovf) setting.............................................................. 329 .com .com .com .com 4 .com u datasheet
viii 12.3.5 timing of watchdog timer overflow flag (wovf) setting.............................. 329 12.4 usage notes ................................................................................................................ ....... 330 12.4.1 contention between wtcnt write and increment ............................................ 330 12.4.2 changing cks2 to cks0 bit values................................................................... 330 12.4.3 switching between watchdog timer and interval timer mode.......................... 330 12.4.4 system reset with wdtovf .............................................................................. 331 12.4.5 internal reset in watchdog timer mode ............................................................. 331 section 13 serial communication interface ................................................................ 333 13.1 overview................................................................................................................... ......... 333 13.1.1 features ................................................................................................................ 3 33 13.1.2 block diagram...................................................................................................... 334 13.1.3 pin configuration ................................................................................................. 334 13.1.4 register configuration ......................................................................................... 335 13.2 register descriptions...................................................................................................... ... 335 13.2.1 receive shift register (rsr)............................................................................... 335 13.2.2 receive data register (rdr) .............................................................................. 335 13.2.3 transmit shift register (tsr).............................................................................. 336 13.2.4 transmit data register (tdr) ............................................................................. 336 13.2.5 serial mode register (smr)................................................................................ 336 13.2.6 serial control register (scr).............................................................................. 339 13.2.7 serial status register (ssr)................................................................................. 342 13.2.8 bit rate register (brr)....................................................................................... 346 13.3 operation .................................................................................................................. ......... 352 13.3.1 overview .............................................................................................................. 352 13.3.2 operation in asynchronous mode........................................................................ 354 13.3.3 multiprocessor communication ........................................................................... 364 13.3.4 clocked synchronous operation.......................................................................... 371 13.4 sci interrupt sources and the dmac............................................................................... 381 13.5 usage notes ................................................................................................................ ....... 381 section 14 power-down modes ...................................................................................... 385 14.1 overview................................................................................................................... ......... 385 14.1.1 power-down modes............................................................................................. 385 14.1.2 register................................................................................................................. 386 14.2 description of register.................................................................................................... .. 387 14.2.1 standby control register (sbycr) .................................................................... 387 14.3 sleep mode................................................................................................................. ....... 389 14.3.1 transition to sleep mode ..................................................................................... 389 14.3.2 canceling sleep mode.......................................................................................... 389 14.4 standby mode............................................................................................................... ..... 389 14.4.1 transition to standby mode ................................................................................. 389 14.4.2 canceling standby mode ..................................................................................... 390 .com .com .com .com 4 .com u datasheet
ix 14.4.3 standby mode cancellation by nmi.................................................................... 391 14.4.4 clock pause function ........................................................................................... 391 14.4.5 notes on standby mode ....................................................................................... 393 14.5 module standby function.................................................................................................. 39 3 14.5.1 transition to module standby function............................................................... 393 14.5.2 clearing the module standby function................................................................ 393 section 15 electrical characteristics (5v version) ................................................... 395 15.1 absolute maximum ratings.............................................................................................. 395 15.2 dc characteristics ......................................................................................................... .... 396 15.3 ac characteristics ......................................................................................................... .... 398 15.3.1 clock timing........................................................................................................ 398 15.3.2 control signal timing.......................................................................................... 402 15.3.3 bus timing ........................................................................................................... 408 15.3.4 dmac timing ..................................................................................................... 474 15.3.5 free-running timer timing ................................................................................ 475 15.3.6 watchdog timer timing ...................................................................................... 476 15.3.7 serial communication interface timing.............................................................. 477 15.3.8 ac characteristics measurement conditions ...................................................... 478 section 16 electrical characteristics (3v version) ................................................... 479 16.1 absolute maximum ratings.............................................................................................. 479 16.2 dc characteristics ......................................................................................................... .... 480 16.3 ac characteristics ......................................................................................................... .... 482 16.3.1 clock timing........................................................................................................ 482 16.3.2 control signal timing.......................................................................................... 486 16.3.3 bus timing ........................................................................................................... 492 16.3.4 dmac timing ..................................................................................................... 558 16.3.5 free-running timer timing ................................................................................ 559 16.3.6 watchdog timer timing ...................................................................................... 560 16.3.7 serial communication interface timing.............................................................. 561 16.3.8 ac characteristics measurement conditions ...................................................... 562 appendix a pin states ....................................................................................................... 563 appendix b list of registers ........................................................................................... 565 appendix c external dimensions .................................................................................. 615 .com .com .com .com 4 .com u datasheet
x .com .com .com .com 4 .com u datasheet
1 section 1 overview and pin functions 1.1 sh7604 features the sh7604 is a new-generation single-chip risc microprocessor that integrates a hitachi- original cpu, a multiplier, cache memory, and peripheral functions required for system configuration. the cpu features a risc-type instruction set . most instructions can be executed in one clock cycle, which greatly improves instruction execution speed . in addition, the on-chip 4-kbyte cache memory and divider enhance data processing ability. the sh7604 is also provided with on-chip peripheral functions including a direct memory access controller (dmac), timers, a serial communication interface (sci), and an interrupt controller . external memory access support functions (provided by the bus state controller) enable direct connection to dram, synchronous dram, and pseudo-sram. the high-speed cpu and comprehensive peripheral functions enable designers to construct high- performance systems with advanced functionality at low cost, even in applications such as real- time control that require very high speeds, impossible with conventional microprocessors. 1.1.1 features of the sh7604 cpu: ? original hitachi architecture ? 32-bit internal configuration ? general-registers: ? sixteen 32-bit general registers ? three 32-bit control registers ? four 32-bit system registers ? risc-type instruction set: ? instruction length: 16-bit fixed length for improved code efficiency ? load-store architecture (basic arithmetic and logic operations are executed between registers) ? delayed conditional/unconditional branch instructions reduce pipeline disruption during branching ? instruction set based on c language ? instruction execution time: one instruction/state (35 ns/instruction at 28.7 mhz operation) ? address space: 4 gbytes available in the architecture (128-mbyte memory space) .com .com .com .com 4 .com u datasheet
2 ? on-chip multiplier: multiply operations (32 bits 32 bits 64 bits) and multiply-and- accumulate operations (32 bits 32 bits + 64 bits 64 bits) executed in 2 to 4 states ? five-stage pipeline operating modes: ? clock mode: selected from the combination of an on-chip oscillator module, a frequency multiplier, clock output, pll synchronization, and 90 phase shifting (the range of choices depends on the package) ? slave/master mode ? processing states ? power-on reset state ? manual reset state ? exception handling state ? program execution state ? power-down state ? bus-released state ? power-down states ? sleep mode ? standby mode ? module stop mode interrupt controller (intc): ? five external interrupt pins (nmi, irl0 to irl3 ), encoded input of 15 external interrupt sources via pins irl0 to irl3 ? twelve internal interrupt sources (dmac 2, divu 1, frt 3, wdt 1, sci 4, ref 1) ? sixteen programmable priority levels ? vector number settable for each internal interrupt source ? auto-vector or external vector selectable as vector for external interrupts via pins irl0 to irl3 ? generates an interrupt when the cpu or dmac generates an address, data, or bus cycle with the specified conditions (address, data, cpu cycle/non-cup cycle, instruction fetch/data access, read/write, byte/word/longword access) ? simplifies configuration of a self-debugger .com .com .com .com 4 .com u datasheet
3 clock pulse generator (cpg)/phase locked loop (pll): ? on-chip clock pulse generator ? crystal clock source or external clock source can be selected ? clock multiplication ( 1, 2, 4), pll synchronization, or 90 phase shift can be selected ? supports clock pause function for frequency change of external clock bus state controller (bsc): ? supports external memory access ? 32-bit external data bus ? memory address space divided into four areas. it is possible to set the following characteristics for each area (32 mbyte linear): ? bus size (8, 16, or 32 bits) ? number of wait cycles settable or not settable ? setting the memory space type simplifies connection to dram, synchronous dram, pseudo-sram, and burst rom ? outputs signals ras , cas , ce , and oe corresponding to dram, synchronous dram, and pseudo-sram areas ? tp cycles can be generated to assure ras precharge time ? address multiplexing is supported internally, so dram and synchronous dram can be connected directly ? outputs chip select signals ( cs0 to cs3 ) for each area ? dram/synchronous dram/pseudo-sram refresh functions ? programmable refresh interval ? supports cas-before-ras refresh and self-refresh modes ? dram/synchronous dram/pseudo-sram burst access function ? supports high-speed access modes for dram/synchronous dram/pseudo-sram ? wait cycles can be inserted by an external wait signal cache memory: ? 4 kbytes ? 64 entries, 4-way set associative, 16-byte line length ? write-through data writing method ? lru replacement algorithm ? 2 kbytes of the cache can be used as 2-kbyte internal ram .com .com .com .com 4 .com u datasheet
4 direct memory access controller (dmac) (2 channels): ? permits dma transfer between external memory, external i/o, on-chip peripheral modules ? enables dma transfer request and auto-request from external pins, on-chip sci, and on-chip timers ? cycle-steal mode or burst mode ? channel priority level is selectable (fixed mode or round-robin mode) ? dual or single address transfer mode is selectable ? transfer data width: 1/2/4/16 bytes ? address space: 4 gbytes; maximum number of transfers: 16,777,216 division unit (divu): ? executes 64 32 32?32 and 32 32 32?32 divisions in 39 cycles ? overflow interrupt 16-bit free-running timer (frt) (1 channel): ? selects input from three internal/external clocks ? input capture and output compare ? counter overflow, compare match, and input capture interrupts watchdog timer (wdt) (1 channel): ? can be switched between watchdog timer and interval timer functions ? count overflow can generate an internal reset, external signal, or interrupt ? power-on reset or manual reset can be selected as the internal reset serial communication interface (sci) (1 channel): ? asynchronous or synchronous mode is selectable ? simultaneous transmission and reception (full duplex) ? dedicated baud rate generator ? multiprocessor communication function package: ? 144-pin plastic qfp (fp-144j) ? 176-pin plastic tfbga (tbp-176) .com .com .com .com 4 .com u datasheet
5 product lineup: product code package operating temperature frequency voltage HD6417604sf28 qfp2020-144 - 20 c to 75 c 28 mhz 5 v HD6417604sfi28 qfp2020-144 - 40 c to 85 c 28 mhz 5 v HD6417604svf20 qfp2020-144 - 20 c to 75 c 20 mhz 3.3 v HD6417604sbp28 csp-1313-176 - 20 c to 75 c 28 mhz 5 v HD6417604svbp20 csp-1313-176 - 20 c to 75 c 20 mhz 3.3 v .com .com .com .com 4 .com u datasheet
6 1.2 block diagram figure 1.1 shows a block diagram of the sh7604. mult cache address array cache controller cache data array external bus interface clock pulse generator bus state controller user break controller 16-bit free running timer serial communi- cation interface watchdog timer operating- mode controller exception handling interrupt controller cpu divu direct memory access controller ( 2 channels) vector address peripheral data bus peripheral address bus internal interrupt signals internal address bus internal data bus cache address bus cache data bus figure 1.1 block diagram .com .com .com .com 4 .com u datasheet
7 1.3 description of pins 1.3.1 pin arrangement 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 d11 d12 d13 v cc d14 v ss d15 d16 d17 d18 d19 d21 d22 d23 v cc d24 v ss d25 d26 v cc d28 v ss d29 d30 v cc d20 v ss d27 29 30 31 32 33 34 35 36 d31 a0 a2 v ss a3 a4 a5 a1 cap1 md1 v ss (pll) md0 v cc (pll) sck txd rxd ftci fti v ss ftoa v cc ftob wdtovf breq / bgr back / brls v ss nc* wait cke rd v ss casll /dqmll/ we0 v cc caslh /dqmlu/ we1 cashl /dqmul/ we2 cashh /dqmuu/ we 3 108 107 106 105 104 103 102 101 100 99 98 94 93 92 91 90 89 88 87 85 84 83 82 81 97 96 95 86 cas / oe ras / ce v ss rd/ wr bs cs3 cs2 cs1 80 79 77 76 75 74 73 78 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 a6 a7 a8 v cc a9 v ss a10 a11 a12 a13 a14 a16 a17 a18 v cc a19 v ss a20 a21 v cc a23 v ss a24 a25 v cc a15 v ss a22 65 66 67 68 69 70 71 72 a26 dack0 dack1 v ss dreq0 dreq1 cs0 v cc d10 d9 d8 v ss d7 v cc d6 d5 d4 d3 v ss d2 v cc d1 d0 irl0 irl1 irl2 irl3 nmi ivecf v cc res v ss md5 md4 ckio md3 144 143 142 141 140 139 138 137 136 135 134 130 129 128 127 126 125 124 123 121 120 119 118 117 133 132 131 122 xtal v ss extal v cc ckpreq /ckm ckrack md2 cap2 116 115 113 112 111 110 109 114 top view (fp-144) HD6417604 note: do not connect anything to the pin abeled nc. figure 1.2 pin arrangement (144-pin plastic qfp) .com .com .com .com 4 .com u datasheet
8 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 abcdefghj klmnpr abcdefghj klmnpr tbp-176 (top view) index mark note: the part surrounded by the interrupt line is perspective. figure 1.3 pin arrangement (176-pin plastic tfbga) .com .com .com .com 4 .com u datasheet
9 1.3.2 pin functions table 1.2 shows the pin functions of the sh7604. table 1.1 pin functions pin no. fp-144 tbp-176 pin name i/o pin description a1 nc reserved pin (leave unconnected) c3 nc reserved pin (leave unconnected) b1 nc reserved pin (leave unconnected) c2 nc reserved pin (leave unconnected) 1 d3 d11 i/o data bus 2 c1 d12 i/o data bus 3 d2 d13 i/o data bus 4e4v cc i power 5 d1 d14 i/o data bus 6e3v ss i ground 7 e2 d15 i/o data bus 8 e1 d16 i/o data bus 9 f4 d17 i/o data bus 10 f3 d18 i/o data bus 11 f1 d19 i/o data bus 12 f2 v cc i power 13 g4 d20 i/o data bus 14 g3 v ss i ground 15 g1 d21 i/o data bus 16 g2 d22 i/o data bus 17 h4 d23 i/o data bus 18 h3 v cc i power 19 h1 d24 i/o data bus 20 h2 v ss i ground 21 j4 d25 i/o data bus 22 j3 d26 i/o data bus 23 j1 d27 i/o data bus 24 j2 v cc i power .com .com .com .com 4 .com u datasheet
10 table 1.1 pin functions (cont) pin no. fp-144 tbp-176 pin name i/o pin description 25 k4 d28 i/o data bus 26 k3 v ss i ground 27 k1 d29 i/o data bus 28 k2 d30 i/o data bus 29 l3 d31 i/o data bus 30 l1 a0 i/o address bus 31 l2 a1 i/o address bus 32 l4 a2 i/o address bus 33 m1 v ss i ground 34 m2 a3 i/o address bus 35 m3 a4 i/o address bus 36 n1 a5 i/o address bus m4 nc reserved pin (leave unconnected) n2 nc reserved pin (leave unconnected) p1 nc reserved pin (leave unconnected) p2 nc reserved pin (leave unconnected) r1 nc reserved pin (leave unconnected) n3 nc reserved pin (leave unconnected) r2 nc reserved pin (leave unconnected) p3 nc reserved pin (leave unconnected) 37 n4 a6 i/o address bus 38 r3 a7 i/o address bus 39 p4 a8 i/o address bus 40 m5 v cc i power 41 r4 a9 i/o address bus 42 n5 v ss i ground 43 p5 a10 i/o address bus 44 r5 a11 i/o address bus 45 m6 a12 i/o address bus 46 n6 a13 i/o address bus 47 r6 a14 i/o address bus .com .com .com .com 4 .com u datasheet
11 table 1.1 pin functions (cont) pin no. fp-144 tbp-176 pin name i/o pin description 48 p6 v cc i power 49 m7 a15 i/o address bus 50 n7 v ss i ground 51 r7 a16 i/o address bus 52 p7 a17 i/o address bus 53 m8 a18 i/o address bus 54 n8 v cc i power 55 r8 a19 i/o address bus 56 p8 v ss i ground 57 m9 a20 i/o address bus 58 n9 a21 i/o address bus 59 r9 a22 i/o address bus 60 p9 v cc i power 61 m10 a23 i/o address bus 62 n10 v ss i ground 63 r10 a24 i/o address bus 64 p10 a25 i/o address bus 65 n11 a26 i/o address bus 66 r11 dack0 o dmac0 acknowledge 67 p11 v cc i power 68 m11 dack1 o dmac1 acknowledge 69 r12 v ss i ground 70 p12 dreq0 i dmac0 request 71 n12 dreq1 i dmac1 request 72 r13 cs0 o chip select 0 m12 nc reserved pin (leave unconnected) p13 nc reserved pin (leave unconnected) r14 nc reserved pin (leave unconnected) p14 nc reserved pin (leave unconnected) r15 nc reserved pin (leave unconnected) n13 nc reserved pin (leave unconnected) .com .com .com .com 4 .com u datasheet
12 table 1.1 pin functions (cont) pin no. fp-144 tbp-176 pin name i/o pin description p15 nc reserved pin (leave unconnected) n14 nc reserved pin (leave unconnected) 73 m13 cs1 o chip select 1 74 n15 cs2 o chip select 2 75 m14 cs3 o chip select 3 76 l12 bs i/o bus cycle start 77 m15 rd/ wr i/o read/write 78 l13 v ss i ground 79 l14 ras / ce o ras for dram and synchronous dram, ce for pseudo-sram 80 l15 cas / oe o cas for synchronous dram, oe for pseudo-sram 81 k12 cashh /dqmuu/ we3 o most significant byte selection signal for memory 82 k13 cashl /dqmul/ we2 o second byte selection signal for memory 83 k15 caslh /dqmlu/ we1 o third byte selection signal for memory 84 k14 v cc i power 85 j12 casll /dqmll/ we0 o least significant byte selection signal for memory 86 j13 v ss i ground 87 j15 rd o read pulse 88 j14 cke o synchronous dram clock enable control 89 h12 wait i hardware wait request 90 h13 nc reserved pin (leave unconnected) 91 h15 v ss i ground 92 h14 back / brls i bus acknowledge in slave mode, bus request in master mode 93 g12 breq / bgr o bus request in slave mode, bus grant in master mode 94 g13 wdtovf o watchdog timer output 95 g15 ftob o free-running timer output b 96 g14 v cc i power .com .com .com .com 4 .com u datasheet
13 table 1.1 pin functions (cont) pin no. fp-144 tbp-176 pin name i/o pin description 97 f12 ftoa o free-running timer output a 98 f13 v ss i ground 99 f15 fti i free-running timer input 100 f14 ftci i free-running timer clock input 101 e13 rxd i serial data input 102 e15 txd o serial data output 103 e14 sck i/o serial clock input/output 104 e12 v cc (pll) i power for on-chip pll 105 d15 md0 i operating mode pin 106 d14 v ss (pll) i ground for on-chip pll 107 d13 md1 i operating mode pin 108 c15 cap1 o external capacitance pin for pll d12 nc reserved pin (leave unconnected) c14 nc reserved pin (leave unconnected) b15 nc reserved pin (leave unconnected) b14 nc reserved pin (leave unconnected) a15 nc reserved pin (leave unconnected) c13 nc reserved pin (leave unconnected) a14 nc reserved pin (leave unconnected) b13 nc reserved pin (leave unconnected) 109 c12 cap2 o external capacitance pin for pll 110 a13 md2 i operating mode pin 111 b12 ckpack o clock pause acknowledge output 112 d11 ckpreq /ckm i clock pause request input 113 a12 v cc i power 114 c11 extal i pin for connecting crystal resonator 115 b11 v ss i ground 116 a11 xtal o pin for connecting crystal resonator 117 d10 md3 i operating mode pin 118 c10 ckio i/o system clock input/output 119 a10 md4 i operating mode pin .com .com .com .com 4 .com u datasheet
14 table 1.1 pin functions (cont) pin no. fp-144 tbp-176 pin name i/o pin description 120 b10 md5 i operating mode pin 121 d9 v ss i ground 122 c9 res i reset 123 a9 v cc power power 124 b9 ivecf o interrupt vector fetch cycle 125 d8 nmi i nonmaskable interrupt request 126 c8 irl3 i external interrupt source input 127 a8 irl2 i external interrupt source input 128 b8 irl1 i external interrupt source input 129 d7 irl0 i external interrupt source input 130 c7 d0 i/o data bus 131 a7 d1 i/o data bus 132 b7 v cc i power 133 d6 d2 i/o data bus 134 c6 v ss i ground 135 a6 d3 i/o data bus 136 b6 d4 i/o data bus 137 c5 d5 i/o data bus 138 a5 d6 i/o data bus 139 b5 v cc i power 140 d5 d7 i/o data bus 141 a4 v ss i ground 142 b4 d8 i/o data bus 143 c4 d9 i/o data bus 144 a3 d10 i/o data bus d4 nc reserved pin (leave unconnected) b3 nc reserved pin (leave unconnected) a2 nc reserved pin (leave unconnected) b2 nc reserved pin (leave unconnected) .com .com .com .com 4 .com u datasheet
15 section 2 cpu 2.1 register configuration the register set consists of sixteen 32-bit general registers, three 32-bit control registers and four 32-bit system registers. 2.1.1 general registers the 16 general registers (r0?15) are shown in figure 2.1. general registers are used for data processing and address calculation. r0 is also used as an index register, and several instructions use r0 as a fixed source or destination register. r15 is used as the hardware stack pointer (sp). saving and recovering the status register (sr) and program counter (pc) in exception handling is accomplished by referencing the stack using r15. r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15, sp (hardware stack pointer) 0 31 * 1 * 2 notes: 1. r0 functions as an index register in the indirect indexed register addressing mode and indirect indexed gbr addressing mode. in some instructions, r0 functions as a fixed source register or destination register. 2. r15 functions as a hardware stack pointer (sp) during exception handling. figure 2.1 general registers .com .com .com .com 4 .com u datasheet
16 2.1.2 control registers the 32-bit control registers consist of the 32-bit status register (sr), global base register (gbr), and vector base register (vbr) (figure 2.2). the status register indicates processing states. the global base register functions as a base address for the gbr indirect addressing mode to transfer data to the registers of on-chip peripheral modules. the vector base register functions as the base address of the exception handling vector area (including interrupts). 9876543210 mqi3 i2 i1 i0 st 0 0 31 31 gbr vbr sr 31 s bit: used by the mac instruction. reserved bits. 0 is read, and only 0 must be written. bits i0?3: interrupt mask bits. m and q bits: used by the div0u, div0s, and div1 instructions. global base register (gbr): indicates the base address of the indirect gbr addressing mode. the indirect gbr addressing mode is used in data transfer for on-chip peripheral module register areas and in logic operations. vector base register (vbr): indicates the base address of the exception handling vector area. sr: status register t bit: the movt, cmp/cond, tas, tst, bt (bt/s), bf (bf/s), sett, and clrt instructions use the t bit to indicate true (1) or false (0). the addv, addc, subv, subc, div0u, div0s, div1, negc, shar, shal, shlr, shll, rotr, rotl, rotcr, and rotcl instructions also use the t bit to indicate carry/borrow or overflow/underflow. figure 2.2 control registers .com .com .com .com 4 .com u datasheet
17 2.1.3 system registers system registers consist of four 32-bit registers: high and low multiply-and-accumulate registers (mach and macl), the procedure register (pr), and the program counter (pc) (figure 2.3). the multiply-and-accumulate registers store the results of multiply and accumulate operations. the procedure register stores the return address from the subroutine procedure. the program counter stores program addresses to control the flow of the processing. macl pr pc mach 31 0 0 0 31 31 multiply and accumulate (mac) registers high and low (mach, macl): store the results of multiply-and-accumulate operations. procedure register (pr): stores a return address from a subroutine procedure. program counter (pc): indicates the fourth byte (second instruction) after the current instruction. figure 2.3 system registers 2.1.4 initial values of registers table 2.1 lists the values of the registers after a reset. table 2.1 initial values of registers classification register initial value general registers r0 r14 undefined r15a (sp) value of the stack pointer in the vector address table control registers sr bits i3 i0 are 1111 (h'f), reserved bits are 0, and other bits are undefined gbr undefined vbr h'00000000 system registers mach, macl, pr undefined pc value of the program counter in the vector address table .com .com .com .com 4 .com u datasheet
18 2.2 data formats 2.2.1 data format in registers register operands are always longwords (32 bits) (figure 2.4). when the memory operand is only a byte (8 bits) or a word (16 bits), it is sign-extended into a longword when loaded into a register. 31 0 longword figure 2.4 longword operand 2.2.2 data format in memory memory data formats are classified into bytes, words, and longwords. byte data can be accessed at any address, but an address error will occur if you try to access word data starting from an address other than 2n or longword data starting from an address other than 4n. in such cases, the data accessed cannot be guaranteed (figure 2.5). the hardware stack area, referred to by the hardware stack pointer (sp, r15), uses only longword data starting from address 4n because this area holds the program counter and status register. this microprocessor has a function that allows access of cs2 space (area 2) in little-endian format, which enables the microprocessor to share memory with processors that access memory in little- endian format. the microprocessor arranges byte data differently for little-endian and the more usual big-endian format. 31 0 15 23 7 byte byte byte byte word word longword address 2n address 4n address m address m + 2 address m + 1 address m + 3 31 0 15 23 7 byte byte byte byte word word longword big-endian format little endian format address m + 3 address m + 1 address m + 2 address m figure 2.5 byte, word, and longword alignment .com .com .com .com 4 .com u datasheet
19 2.2.3 immediate data format byte (8-bit) immediate data resides in an instruction code. immediate data accessed by the mov, add, and cmp/eq instructions is sign-extended and handled in registers as longword data. immediate data accessed by the tst, and, or, and xor instructions is zero-extended and handled as longword data. consequently, and instructions with immediate data always clear the upper 24 bits of the destination register. word or longword immediate data is not located in the instruction code: it is stored in a memory table. an immediate data transfer instruction (mov) accesses the memory table using the pc relative with displacement addressing mode. specific examples are given in table 2.5, immediate data accessing. 2.3 instruction features 2.3.1 risc-type instruction set all instructions are risc type. this section details their functions. 16-bit fixed length : all instructions are 16 bits long, increasing program code efficiency. one instruction per cycle : the microprocessor can execute basic instructions in one cycle using the pipeline system. instructions are executed in 35 ns at 28.7 mhz. data length : longword is the standard data length for all operations. memory can be accessed in bytes, words, or longwords. byte or word data accessed from memory is sign-extended and handled as longword data (table 2.2). immediate data is sign-extended for arithmetic operations or zero-extended for logic operations. it also is handled as longword data. table 2.2 sign extension of word data sh7604 cpu description example of conventional cpu mov.w @(disp,pc),r1 add r1,r0 ......... .data.w h'1234 data is sign-extended to 32 bits, and r1 becomes h'00001234. it is next operated upon by an add instruction. add.w #h'1234,r0 note: @(disp, pc) accesses the immediate data. load-store architecture : basic operations are executed between registers. for operations that involve memory access, data is loaded into the registers and executed (load-store architecture). instructions such as and that manipulate bits, however, are executed directly in memory. .com .com .com .com 4 .com u datasheet
20 delayed branch instructions : unconditional branch instructions are delayed. executing the instruction that follows the branch instruction, before branching reduces pipeline disruption during branching (table 2.3). table 2.3 delayed branch instructions sh7604 series cpu description example of conventional cpu bra trget add r1,r0 executes add before branching to trget add.w r1,r0 bra trget multiply and multiply-and-accumulate operations: 16-bit 16-bit 32-bit multiply operations are executed in one to two states. 16-bit 16-bit + 64-bit 64-bit multiply-and- accumulate operations are executed in two to three states. 32-bit 32-bit 64-bit multiply and 32-bit 32-bit + 64bit 64-bit multiply-and-accumulate operations are executed in two to four states. t bit : the t bit in the status register changes according to the result of the comparison, and in turn is the condition (true/false) that determines if the program will branch (table 2.4). the number of instructions that change the t bit is kept to a minimum to improve the processing speed. table 2.4 t bit sh7604 cpu description example of conventional cpu cmp/ge r1,r0 bt trget0 bf trget1 t bit is set when r0 cmp.w r1,r0 bge trget0 blt trget1 add #?,r0 cmp/eq #0,r0 bt trget t bit is not changed by add. t bit is set when r0 = 0. the program branches if r0 = 0. sub.w #1,r0 beq trget immediate data : byte (8-bit) immediate data resides in the instruction code. word or longword immediate data is not input via instruction codes but is stored in a memory table. an immediate data transfer instruction (mov) accesses the memory table using the pc relative with displacement addressing mode (table 2.5). .com .com .com .com 4 .com u datasheet
21 table 2.5 immediate data accessing classification sh7604 cpu example of conventional cpu 8-bit immediate mov #h'12,r0 mov.b #h'12,r0 16-bit immediate mov.w @(disp,pc),r0 ................. .data.w h'1234 mov.w #h'1234,r0 32-bit immediate mov.l @(disp,pc),r0 ................. .data.l h'12345678 mov.l #h'12345678,r0 note: @(disp, pc) accesses the immediate data. absolute address : when data is accessed by absolute address, the absolute address value is placed in the memory table beforehand. loading the immediate data when the instruction is executed transfers that value to the register and the data is accessed in the register indirect addressing mode (table 2.6). table 2.6 absolute address accessing classification sh7604 cpu example of conventional cpu absolute address mov.l @(disp,pc),r1 mov.b @r1,r0 .................. .data.l h'12345678 mov.b @h'12345678,r0 note: @(disp,pc) accesses the immediate data. 16-bit/32-bit displacement : when data is accessed by 16-bit or 32-bit displacement, the displacement value is placed in the memory table beforehand. loading the immediate data when the instruction is executed transfers that value to the register and the data is accessed in the indexed register indirect addressing addressing mode (table 2.7). table 2.7 16/32-bit displacement accessing classification sh7604 cpu example of conventional cpu 16-bit displacement mov.w @(disp,pc),r0 mov.w @(r0,r1),r2 .................. .data.w h'1234 mov.w @(h'1234,r1),r2 note: @(disp,pc) accesses the immediate data. .com .com .com .com 4 .com u datasheet
22 2.3.2 addressing modes table 2.8 shows addressing modes and effective address calculation. table 2.8 addressing modes and effective addresses addressing mode instruction format effective addresses calculation equation register direct rn the effective address is register rn. (the operand is the contents of register rn.) register indirect @rn the effective address is the contents of register rn. rn rn rn register indirect with post-increment @rn+ the effective address is the contents of register rn. a constant is added to the contents of rn after the instruction is executed. 1 is added for a byte operation, 2 for a word operation, and 4 for a longword operation. rn rn 1/2/4 + rn + 1/2/4 rn (after the instruction executes) byte: rn + 1 rn the effective address is the value obtained by subtracting a constant from rn. 1 is subtracted for a byte operation, 2 for a word operation, and 4 for a longword operation. rn 1/2/4 rn 1/2/4 rn 1/2/4 byte: rn 1 2 4 .com .com .com .com 4 .com u datasheet
23 table 2.8 addressing modes and effective addresses (cont) addressing mode instruction format effective addresses calculation equation register indirect with displacement @(disp:4, rn) the effective address is rn plus a 4-bit displacement (disp). the value of disp is zero- extended, and remains the same for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. rn rn + disp .com .com .com .com 4 .com u datasheet
24 table 2.8 addressing modes and effective addresses (cont) addressing mode instruction format effective addresses calculation equation pc relative with displacement @(disp:8, pc) the effective address is the pc value plus an 8-bit displacement (disp). the value of disp is zero- extended, and remains the same for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. for a longword operation, the lowest two bits of the pc value are masked. pc h'fffffffc pc + disp .com .com .com .com 4 .com u datasheet
25 table 2.8 addressing modes and effective addresses (cont) addressing mode instruction format effective addresses calculation equation pc relative (cont) rn the effective address is the register pc value plus rn. pc rn pc + rn + pc + rn immediate #imm:8 the 8-bit immediate data (imm) for the tst, and, or, and xor instructions is zero-extended. #imm:8 the 8-bit immediate data (imm) for the mov, add, and cmp/eq instructions is sign-extended. #imm:8 the 8-bit immediate data (imm) for the trapa instruction is zero-extended and quadrupled. 2.3.3 instruction formats table 2.9 shows instruction formats and source and destination operands. the meaning of the operands depends on the instruction code. the following symbols are used in the table: ? xxxx: instruction code ? mmmm: source register ? nnnn: destination register ? iiii: immediate data ? dddd: displacement .com .com .com .com 4 .com u datasheet
26 table 2.9 instruction formats instruction format source operand destination operand example 0 format xxxx xxxx xxxx xxxx 15 0 nop n format xxxx xxxx xxxx nnnn 15 0 nnnn : register direct movt rn control register or system register nnnn : register direct sts mach,rn control register or system register nnnn : register indirect with pre-decrement stc.l sr,@-rn m format xxxx mmmm xxxx xxxx 15 0 mmmm : register direct control register or system register ldc rm,sr mmmm : register indirect with post-increment control register or system register ldc.l @rm+,sr mmmm : register indirect jmp @rm mmmm : pc relative using rm braf rm .com .com .com .com 4 .com u datasheet
27 table 2.9 instruction formats (cont) instruction format source operand destination operand example nm format mmmm : register direct nnnn : register direct add rm,rn nnnn xxxx xxxx 15 0 mmmm mmmm : register direct nnnn : register indirect mov.l rm,@rn mmmm : register indirect with post- increment (multiply- and-accumulate) nnnn : register indirect with post- increment (multiply- and-accumulate)* mach, macl mac.w @rm+,@rn+ mmmm : register indirect with post-increment nnnn : register direct mov.l @rm+,rn mmmm : register direct nnnn : register indirect with pre-decrement mov.l rm,@-rn mmmm : register direct nnnn : indexed register indirect mov.l rm,@(r0,rn) md format xxxx dddd 15 0 mmmm xxxx mmmmdddd : register indirect with displacement r0 (register direct) mov.b @(disp,rn),r0 nd4 format xxxx xxxx dddd 15 0 nnnn r0 (register direct) nnnndddd : register indirect with displacement mov.b r0,@(disp,rn) nmd format nnnn xxxx dddd 15 0 mmmm mmmm : register direct nnnndddd : register indirect with displacement mov.l rm,@(disp,rn) mmmmdddd : register indirect with displacement nnnn : register direct mov.l @(disp,rm),rn .com .com .com .com 4 .com u datasheet
28 table 2.9 instruction formats (cont) instruction format source operand destination operand example d format dddd xxxx 15 0 xxxx dddd dddddddd : gbr indirect with displacement r0 (register direct) mov.l @(disp,gbr),r0 r0 (register direct) dddddddd : gbr indirect with displacement mov.l r0,@(disp,gbr) dddddddd : pc relative with displacement r0 (register direct) mova @(disp,pc),r0 dddddddd : pc relative bf label d12 format dddd xxxx 15 0 dddd dddd dddddddddddd : pc relative bra label (label = disp + pc) nd8 format dddd nnnn xxxx 15 0 dddd dddddddd : pc relative with displacement nnnn : register direct mov.l @(disp,pc),rn i format iiiiiiii: immediate indexed gbr indirect and.b #imm,@(r0,gbr) xxxx xxxx i i i i 15 0 i i i i iiiiiiii : immediate r0 (register direct) and #imm,r0 iiiiiiii: immediate trapa #imm ni format nnnn i i i i xxxx 15 0 i i i i iiiiiiii : immediate nnnn : register direct add #imm,rn note: in multiply-and-accumulate instructions, nnnn is the source register. .com .com .com .com 4 .com u datasheet
29 2.4 instruction set 2.4.1 instruction set by classification table 2.10 instruction set by classification classification types operation code function number of instructions data transfer 5 mov data transfer, immediate data transfer, peripheral module data transfer, structure data transfer 39 mova effective address transfer movt t bit transfer swap swap of upper and lower bytes xtrct extraction of middle of connected registers arithmetic 21 add binary addition 33 operations addc binary addition with carry addv binary addition with overflow check cmp/cond comparison div1 division div0s initialization of signed division div0u initialization of unsigned division dmuls signed double-length multiplication dmulu unsigned double-length multiplication dt decrement and test exts sign extension extu zero extension mac multiply-and-accumulate, double-length multiply- and-accumulate operation mul double-length multiplication muls signed multiplication mulu unsigned multiplication neg negation negc negation with borrow sub binary subtraction subc binary subtraction with borrow subv binary subtraction with underflow check .com .com .com .com 4 .com u datasheet
30 table 2.10 instruction set by classification (cont) classification types operation code function number of instructions logic 6 and logical and 14 operations not bit inversion or logical or tas memory test and bit set tst logical and and t bit set xor exclusive or shift 10 rotl one-bit left rotation 14 rotr one-bit right rotation rotcl one-bit left rotation with t bit rotcr one-bit right rotation with t bit shal one-bit arithmetic left shift shar one-bit arithmetic right shift shll one-bit logical left shift shlln n-bit logical left shift shlr one-bit logical right shift shlrn n-bit logical right shift branch 9 bf conditional branch, conditional branch with delay (t = 0) 11 bt conditional branch, conditional branch with delay (t = 1) bra unconditional branch braf unconditional branch bsr branch to subroutine procedure bsrf branch to subroutine procedure jmp unconditional branch jsr branch to subroutine procedure rts return from subroutine procedure .com .com .com .com 4 .com u datasheet
31 table 2.10 instruction set by classification (cont) classification types operation code function number of instructions system 11 clrt t bit clear 31 control clrmac mac register clear ldc load to control register lds load to system register nop no operation rte return from exception handling sett t bit set sleep shift to power-down state stc store control register data sts store system register data trapa trap exception handling total:62 142 .com .com .com .com 4 .com u datasheet
32 table 2.11 instruction code format item format explanation instruction mnemonic op.sz src,dest op: operation code sz: size (b: byte, w: word, or l: longword) src: source dest: destination rm: source register rn: destination register imm: immediate data disp: displacement* 1 instruction code msb ? value when no wait states are inserted* 2 t bit value of t bit after instruction is executed. an em-dash ( ) in the column means no change. notes: 1. depending on the operand size, displacement is scaled contention occurs between instruction fetch and data access the destination register of the load instruction (memory .com .com .com .com 4 .com u datasheet
33 table 2.12 data transfer instructions instruction instruction code operation execu- tion states t bit mov #imm,rn 1110nnnniiiiiiii #imm mov.w @(disp,pc),rn 1001nnnndddddddd (disp mov.l @(disp,pc),rn 1101nnnndddddddd (disp mov rm,rn 0110nnnnmmmm0011 rm mov.b rm,@rn 0010nnnnmmmm0000 rm mov.w rm,@rn 0010nnnnmmmm0001 rm mov.l rm,@rn 0010nnnnmmmm0010 rm mov.b @rm,rn 0110nnnnmmmm0000 (rm) mov.w @rm,rn 0110nnnnmmmm0001 (rm) mov.l @rm,rn 0110nnnnmmmm0010 (rm) mov.b rm,@?n 0010nnnnmmmm0100 rn 1 mov.w rm,@?n 0010nnnnmmmm0101 rn 2 mov.l rm,@?n 0010nnnnmmmm0110 rn 4 mov.b @rm+,rn 0110nnnnmmmm0100 (rm) mov.w @rm+,rn 0110nnnnmmmm0101 (rm) mov.l @rm+,rn 0110nnnnmmmm0110 (rm) mov.b r0,@(disp,rn) 10000000nnnndddd r0 mov.w r0,@(disp,rn) 10000001nnnndddd r0 mov.l rm,@(disp,rn) 0001nnnnmmmmdddd rm mov.b @(disp,rm),r0 10000100mmmmdddd (disp + rm) mov.w @(disp,rm),r0 10000101mmmmdddd (disp mov.l @(disp,rm),rn 0101nnnnmmmmdddd (disp mov.b rm,@(r0,rn) 0000nnnnmmmm0100 rm mov.w rm,@(r0,rn) 0000nnnnmmmm0101 rm mov.l rm,@(r0,rn) 0000nnnnmmmm0110 rm .com .com .com .com 4 .com u datasheet
34 table 2.12 data transfer instructions (cont) instruction instruction code operation execu- tion states t bit mov.b @(r0,rm),rn 0000nnnnmmmm1100 (r0 + rm) mov.w @(r0,rm),rn 0000nnnnmmmm1101 (r0 + rm) mov.l @(r0,rm),rn 0000nnnnmmmm1110 (r0 + rm) mov.b r0,@(disp,gbr) 11000000dddddddd r0 mov.w r0,@(disp,gbr) 11000001dddddddd r0 mov.l r0,@(disp,gbr) 11000010dddddddd r0 mov.b @(disp,gbr),r0 11000100dddddddd (disp + gbr) mov.w @(disp,gbr),r0 11000101dddddddd (disp mov.l @(disp,gbr),r0 11000110dddddddd (disp mova @(disp,pc),r0 11000111dddddddd disp movt rn 0000nnnn00101001 t swap.b rm,rn 0110nnnnmmmm1000 rm swap.w rm,rn 0110nnnnmmmm1001 rm xtrct rm,rn 0010nnnnmmmm1101 rm: middle 32 bits of rn .com .com .com .com 4 .com u datasheet
35 table 2.13 arithmetic instructions instruction instruction code operation execution states t bit add rm,rn 0011nnnnmmmm1100 rn + rm add #imm,rn 0111nnnniiiiiiii rn + imm addc rm,rn 0011nnnnmmmm1110 rn + rm + t addv rm,rn 0011nnnnmmmm1111 rn + rm cmp/eq #imm,r0 10001000iiiiiiii if r0 = imm, 1 cmp/eq rm,rn 0011nnnnmmmm0000 if rn = rm, 1 cmp/hs rm,rn 0011nnnnmmmm0010 if rn cmp/ge rm,rn 0011nnnnmmmm0011 if rn cmp/hi rm,rn 0011nnnnmmmm0110 if rn > rm with unsigned data, 1 cmp/gt rm,rn 0011nnnnmmmm0111 if rn > rm with signed data, 1 cmp/pz rn 0100nnnn00010001 if rn cmp/pl rn 0100nnnn00010101 if rn > 0, 1 cmp/st rm,rn 0010nnnnmmmm1100 if rn and rm have an equivalent byte, 1 div1 rm,rn 0011nnnnmmmm0100 single-step division (rn div0s rm,rn 0010nnnnmmmm0111 msb of rn div0u 0000000000011001 0 dmuls. rm,rn 0011nnnnmmmm1101 signed operation of rn .com .com .com .com 4 .com u datasheet
36 table 2.13 arithmetic instructions (cont) instruction instruction code operation execution states t bit dmulu.l rm,rn 0011nnnnmmmm0101 unsigned operation of rn dt rn 0100nnnn00010000 rn 1 exts.b rm,rn 0110nnnnmmmm1110 a byte in rm is sign- extended exts.w rm,rn 0110nnnnmmmm1111 a word in rm is sign- extended extu.b rm,rn 0110nnnnmmmm1100 a byte in rm is zero- extended extu.w rm,rn 0110nnnnmmmm1101 a word in rm is zero- extended mac.l @rm+,@rn+ 0000nnnnmmmm1111 signed operation of (rn) mac @rm+,@rn+ 0100nnnnmmmm1111 signed operation of (rn) mul.l rm,rn 0000nnnnmmmm0111 rn muls.w rm,rn 0010nnnnmmmm1111 signed operation of rn mulu.w rm,rn 0010nnnnmmmm1110 unsigned operation of rn neg rm,rn 0110nnnnmmmm1011 0 rm negc rm,rn 0110nnnnmmmm1010 0 rm t .com .com .com .com 4 .com u datasheet
37 table 2.13 arithmetic instructions (cont) instruction instruction code operation execution states t bit sub rm,rn 0011nnnnmmmm1000 rn rm subc rm,rn 0011nnnnmmmm1010 rn rm t subv rm,rn 0011nnnnmmmm1011 rn rm table 2.14 logic operation instructions instruction instruction code operation execu- tion states t bit and rm,rn 0010nnnnmmmm1001 rn & rm and #imm,r0 11001001iiiiiiii r0 & imm and.b #imm,@(r0,gbr) 11001101iiiiiiii (r0 + gbr) & imm not rm,rn 0110nnnnmmmm0111 ~rm or rm,rn 0010nnnnmmmm1011 rn | rm or #imm,r0 11001011iiiiiiii r0 | imm or.b #imm,@(r0,gbr) 11001111iiiiiiii (r0 + gbr) | imm tas.b @rn 0100nnnn00011011 if (rn) is 0, 1 tst rm,rn 0010nnnnmmmm1000 rn & rm; if the result is 0, 1 tst #imm,r0 11001000iiiiiiii r0 & imm; if the result is 0, 1 tst.b #imm,@(r0,gbr) 11001100iiiiiiii (r0 + gbr) & imm; if the result is 0, 1 xor rm,rn 0010nnnnmmmm1010 rn ^ rm xor #imm,r0 11001010iiiiiiii r0 ^ imm xor.b #imm,@(r0,gbr) 11001110iiiiiiii (r0 + gbr) ^ imm .com .com .com .com 4 .com u datasheet
38 table 2.15 shift instructions instruction instruction code operation execution states t bit rotl rn 0100nnnn00000100 t rotr rn 0100nnnn00000101 lsb rotcl rn 0100nnnn00100100 t rotcr rn 0100nnnn00100101 t shal rn 0100nnnn00100000 t shar rn 0100nnnn00100001 msb shll rn 0100nnnn00000000 t shlr rn 0100nnnn00000001 0 shll2 rn 0100nnnn00001000 rn<<2 shlr2 rn 0100nnnn00001001 rn>>2 shll8 rn 0100nnnn00011000 rn<<8 shlr8 rn 0100nnnn00011001 rn>>8 shll16 rn 0100nnnn00101000 rn<<16 shlr16 rn 0100nnnn00101001 rn>>16 .com .com .com .com 4 .com u datasheet
39 table 2.16 branch instructions instruction instruction code operation execution states t bit bf label 10001011dddddddd if t = 0, disp bf/s label 10001111dddddddd delayed branch, if t = 0, disp bt label 10001001dddddddd delayed branch, if t = 1, disp bt/s label 10001101dddddddd if t = 1, disp bra label 1010dddddddddddd delayed branch, disp braf rm 0000mmmm00100011 delayed branch, rm + pc bsr label 1011dddddddddddd delayed branch, pc bsrf rm 0000mmmm00000011 delayed branch, pc jmp @rm 0100mmmm00101011 delayed branch, rm jsr @rm 0100mmmm00001011 delayed branch, pc rts 0000000000001011 delayed branch, pr note: one state when the instruction does not branch. .com .com .com .com 4 .com u datasheet
40 table 2.17 system control instructions instruction instruction code operation execu- tion states t bit clrt 0000000000001000 0 clrmac 0000000000101000 0 ldc rm,sr 0100mmmm00001110 rm ldc rm,gbr 0100mmmm00011110 rm ldc rm,vbr 0100mmmm00101110 rm ldc.l @rm+,sr 0100mmmm00000111 (rm) ldc.l @rm+,gbr 0100mmmm00010111 (rm) ldc.l @rm+,vbr 0100mmmm00100111 (rm) lds rm,mach 0100mmmm00001010 rm lds rm,macl 0100mmmm00011010 rm lds rm,pr 0100mmmm00101010 rm lds.l @rm+,mach 0100mmmm00000110 (rm) lds.l @rm+,macl 0100mmmm00010110 (rm) lds.l @rm+,pr 0100mmmm00100110 (rm) nop 0000000000001001 no operation 1 rte 0000000000101011 delayed branch, stack area sett 0000000000011000 1 sleep 0000000000011011 sleep 3 * stc sr,rn 0000nnnn00000010 sr stc gbr,rn 0000nnnn00010010 gbr stc vbr,rn 0000nnnn00100010 vbr stc.l sr,@?n 0100nnnn00000011 rn 4 stc.l gbr,@?n 0100nnnn00010011 rn 4 stc.l vbr,@?n 0100nnnn00100011 rn 4 .com .com .com .com 4 .com u datasheet
41 table 2.17 system control instructions (cont) instruction instruction code operation execu- tion states t bit sts mach,rn 0000nnnn00001010 mach sts macl,rn 0000nnnn00011010 macl sts pr,rn 0000nnnn00101010 pr sts.l mach,@?n 0100nnnn00000010 rn 4 sts.l macl,@?n 0100nnnn00010010 rn 4 sts.l pr,@?n 0100nnnn00100010 rn 4 trapa #imm 11000011iiiiiiii pc/sr note: the number of execution states before the chip enters the sleep mode. instruction states: the values shown for the execution states are minimums. the actual number of states may be increased when: contention occurs between instruction fetch and data access the destination register of the load instruction (memory .com .com .com .com 4 .com u datasheet
42 2.4.2 operation code map table 2.18 operation code map instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 0000 rn fx 0000 0000 rn fx 0001 0000 rn fx 0010 stc sr,rn stc gbr,rn stc vbr,rn 0000 rm fx 0011 bsrf rm braf rm 0000 rn rm 01md mov.b rm, @(r0,rn) mov.w rm, @(r0,rn) mov.l rm, @(r0,rn) mul.l rm,rn 0000 0000 fx 1000 clrt sett clrmac 0000 0000 fx 1001 nop divou 0000 0000 fx 1010 0000 0000 fx 1011 rts sleep rte 0000 rn fx 1000 0000 rn fx 1001 movt rn 0000 rn fx 1010 sts mach,rn sts macl,rn sts pr,rn 0000 rn fx 1011 0000 rn rm 11md mov.b @(r0,rm),rn mov.w @(r0,rm),rn mov.l @(r0,rm),rn mac.l @rm+,@rn+ 0001 rn rm disp mov.l rm,@(disp:4,rn) 0010 rn rm 00md mov.b rm,@rn mov.w rm,@rn mov.l rm,@rn 0010 rn rm 01md mov.b rm, @-rn mov.w rm, @?n mov.l rm, @?n div0s rm,rn 0010 rn rm 10md tst rm,rn and rm,rn xor rm,rn or rm,rn 0010 rn rm 11md cmp/str rm,rn xtrct rm,rn mulu.w rm,rn muls.w rm,rn 0011 rn rm 00md cmp/eq rm,rn cmp/hs rm,rn cmp/ge rm,rn 0011 rn rm 01md div1 rm,rn dmulu.l rm,rn cmp/hi rm,rn cmp/gt rm,rn 0011 rn rm 10md sub rm,rn subc rm,rn subv rm,rn 0011 rn rm 11md add rm,rn dmuls.l rm,rn addc rm,rn addv rm,rn 0100 rn fx 0000 shll rn dt rn shal rn .com .com .com .com 4 .com u datasheet
43 table 2.18 operation code map (cont) instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 0100 rn fx 0001 shlr rn cmp/pz rn shar rn 0100 rn fx 0010 sts.l mach, @?n sts.l macl, @?n sts.l pr, @?n 0100 rn fx 0011 stc.l sr,@?n stc.l gbr,@?n stc.l vbr,@?n 0100 rn fx 0100 rotl rn rotcl rn 0100 rn fx 0101 rotr rn cmp/pl rn rotcr rn 0100 rm fx 0110 lds.l @rm+,mach lds.l @rm+,macl lds.l @rm+,pr 0100 rm fx 0111 ldc.l @rm+,sr ldc.l @rm+,gbr ldc.l @rm+,vbr 0100 rn fx 1000 shll2 rn shll8 rn shll16 rn 0100 rn fx 1001 shlr2 rn shlr8 rn shlr16 rn 0100 rm fx 1010 lds rm,mach lds rm,macl lds rm,pr 0100 rm/rn fx 1011 jsr @rm tas.b @rn jmp @rm 0100 rm fx 1100 0100 rm fx 1101 0100 rm fx 1110 ldc rm,sr ldc rm,gbr ldc rm,vbr 0100 rn rm 1111 mac.w @rm+,@rn+ 0101 rn rm disp mov.l @(disp:4,rm),rn 0110 rn rm 00md mov.b @rm,rn mov.w @rm,rn mov.l @rm,rn mov rm,rn 0110 rn rm 01md mov.b @rm+,rn mov.w @rm+,rn mov.l @rm+,rn not rm,rn 0110 rn rm 10md swap.b rm,rn swap.w rm,rn negc rm,rn neg rm,rn 0110 rn rm 11md extu.b rm,rn extu.w rm,rn exts.b rm,rn exts.w rm,rn 0111 rn imm add #imm:8,rn 1000 00md rn disp mov.b r0, @(disp:4,rn) mov.w r0, @(disp:4,rn) 1000 01md rm disp mov.b @(disp:4, rm),r0 mov.w @(disp:4, rm),r0 .com .com .com .com 4 .com u datasheet
44 table 2.18 operation code map (cont) instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 1000 10md imm/disp cmp/eq #imm:8,r0 bt label:8 bf label:8 1000 10md imm/disp bt/s label:8 bf/s label:8 1001 rn disp mov.w @(disp:8,pc),rn 1010 disp bra label:12 1011 disp bsr label:12 1100 00md imm/disp mov.b r0, @(disp:8, gbr) mov.w r0, @(disp:8, gbr) mov.l r0, @(disp:8, gbr) trapa #imm:8 1100 01md disp mov.b @(disp:8, gbr),r0 mov.w @(disp:8, gbr),r0 mov.l @(disp:8, gbr),r0 mova @(disp:8, pc),r0 1100 10md imm tst #imm:8,r0 and #imm:8,r0 xor #imm:8,r0 or #imm:8,r0 1100 11md imm tst.b #imm:8, @(r0,gbr) and.b #imm:8, @(r0,gbr) xor.b #imm:8, @(r0,gbr) or.b #imm:8, @(r0,gbr) 1101 rn disp mov.l @(disp:8,pc),rn 1110 rn imm mov #imm:8,rn 1111 ... 2.5 processing states 2.5.1 state transitions the cpu has five processing states: reset, exception handling, bus-released, program execution, and power-down. figure 2.6 shows the transitions between the states. see section 14, power- down state, for more information on the power-down state. .com .com .com .com 4 .com u datasheet
45 res res res res res res figure 2.6 transitions between processing states .com .com .com .com 4 .com u datasheet
46 reset state: the cpu resets in the reset state. this occurs when the res pin level goes low. when the nmi pin is high, the result is a power-on reset; when it is low, a manual reset will occur. exception handling state : the exception handling state is a transient state that occurs when an exception handling source such as a reset or interrupt alters the cpu? processing state flow. for a reset, the initial values of the program counter (pc) (execution start address) and stack pointer (sp) are fetched from the exception vector table and stored; the cpu then branches to the execution start address and execution of the program begins. for an interrupt, the stack pointer (sp) is accessed and the program counter (pc) and status register (sr) are saved to the stack area. the exception service routine start address is fetched from the exception processing vector table; the cpu then branches to that address and the program starts executing, thereby entering the program execution state. program execution state : in the program execution state, the cpu sequentially executes the program. power-down state : in the power-down state, the cpu operation halts and power consumption declines. the sleep instruction places the cpu in the power-down state. this state has two modes: sleep mode and standby mode. see section 2.5.2 for more details. bus-released state : in the bus-released state, the cpu releases the bus to the device that has requested it. 2.5.2 power-down state besides the ordinary program execution states, the cpu also has a power-down state in which cpu operation halts, lowering power consumption (table 2.19). there are two power-down state modes, sleep mode and standby mode, and also a module standby function. sleep mode : when standby bit sby (in the standby control register sbycr) is cleared to 0 and a sleep instruction executed, the cpu moves from program execution state to sleep mode. the on- chip peripheral modules other than the cpu do not halt in the sleep mode. to return from sleep mode, use a reset, any interrupt, or a dma address error; the cpu returns to the ordinary program execution state through the exception handling state. software standby mode : to enter the standby mode, set the standby bit sby (in the standby control register sbycr) to 1 and execute a sleep instruction. in standby mode, all cpu, on-chip peripheral module, and oscillator functions are halted. when entering the standby mode, confirm that the dmac master enable bit is 0. if a multiply instruction is in progress on entry to standby mode, the macl and mach registers will be invalid. cpu internal register contents and on-chip ram data are retained. cache (and on-chip ram) data is not retained. .com .com .com .com 4 .com u datasheet
47 to return from standby mode, use a reset or an external nmi interrupt. for resets, the cpu returns to the ordinary program execution state through the exception handling state when placed in a reset state after the oscillator stabilization time has elapsed. for nmi interrupts, the cpu returns to the ordinary program execution state through the exception handling state after the oscillator stabilization time has elapsed. turn the cache off before entering standby mode. in this mode, power consumption drops substantially because the oscillator stops. module standby function : the module standby function is available for the multiplier (mult), divider (divu), 16-bit free-running timer (frt), serial communication interface (sci), and dma controller (dmac) on-chip peripheral modules. the supply of the clock to these on-chip peripheral modules can be halted by setting the corresponding bits 4? (mstp4?stp0) in the standby control register (sbycr). by using this function, the power consumption can be reduced. the external pins of the on-chip peripheral modules in module standby mode are reset and all registers except dmac, mult, and divu are initialized. the module standby function is cleared by clearing the mstp4?stp0 bits to 0. when mult has entered the software standby mode, do not execute the dmuls.l, dmulu.l, mac.l, mac.w, mul.l, muls, and mulu instructions (all of which are multiply instructions) or any instructions that access the mach and macl registers (clrmac, lds mach/macl, sts mach/macl). when the dmac module standby function is used, set the dmac? dma master enable bit to 0. .com .com .com .com 4 .com u datasheet
48 table 2.19 power-down state state mode conditions clock cpu on-chip peripheral modules cpu registers ram canceling sleep execute sleep instruction with sby bit cleared to 0 in sbycr active halted active held held 1. interrupt 2. dma address error 3. power-on reset 4. manual reset standby execute sleep instruction with sby bit set to 1 in sbycr halted halted halted and initialized *1 held undefined 1. nmi 2. power-on reset 3. manual reset module standby mstp4 mstp0 bits of sbycr set to 1 active active (mult is halted.) supply of clock to affected module is halted and module initialized. *2 held held clear bits mstp 4 0 of sbycr to 0 notes: 1. depends on peripheral module and pin. 2. the dmac, mult, and div registers and the specified interrupt vectors retain their settings. .com .com .com .com 4 .com u datasheet
49 section 3 oscillator circuits and operating modes 3.1 overview operation of the on-chip clock pulse generator, cs0 area bus width specification, and switching between master and slave modes are controlled by the operating mode pins. a crystal resonator or external clock can be selected as the clock source. 3.2 on-chip clock pulse generator and operating modes 3.2.1 clock pulse generator a block diagram of the on-chip clock pulse generator circuit is shown in figure 3.1. cap1 ckio extal xtal ckpreq / ckm ckpack * md2 clock mode pins md1 md0 standby control signal clock pll circuit 1 clock mode control circuit cap2 pll circuit 2 oscillator note: see section 14.4.4, clock pause function figure 3.1 block diagram of clock pulse generator circuit .com .com .com .com 4 .com u datasheet
50 pin configuration: table 3.1 lists the functions relating to the pins relating to the oscillator circuit. table 3.1 pin functions pin name i/o function ckio i/o external clock input pin or internal clock output pin xtal o connects to the crystal resonator. extal i connects to the crystal resonator or to the external clock input when using pll circuit 2. cap1 i connects to capacitance for operating pll circuit 1. cap2 i connects to capacitance for operating pll circuit 2. md0 i the level applied to these pins specifies the clock mode. md1 i md2 i ckpreq /ckm i used as the clock pause request pin, or specifies operation of the crystal oscillator. pll circuit 1: pll circuit 1 eliminates phase differences between external clocks and clocks supplied internally within the chip. in high-speed operation, the phase difference between the reference clocks and operating clocks in the chip directly affects the interface margin with peripheral devices . on-chip pll circuit 1 is provided to eliminate this effect. pll circuit 1 can also make the phase difference between the clocks 90 degrees, enabling high- speed interface with synchronous dram. pll circuit 2: pll circuit 2 either leaves unchanged, doubles, or quadruples the frequency of clocks provided from the crystal resonator or the extal pin external clock input for the chip operating frequency . the frequency modification register sets the clock frequency multiplication factor. .com .com .com .com 4 .com u datasheet
51 3.2.2 clock operating mode settings table 3.2 lists the functions and operation of clock modes 0 to 6. note that tbp-176 package products can only be used in clock modes 4 to 6. table 3.2 operating modes clock mode function/operation clock source 0 pll circuits 1 and 2 operate. a clock with the same phase as the internal chip clock is output from the ckio pin. crystal resonator/ external clock input 1 pll circuits 1 and 2 operate. a clock shifted 90 from the ckio pin output is supplied to the internal chip clock. crystal resonator/ external clock input 2 only pll circuit 2 operates. the clock from pll circuit 2 is output from the ckio pin. phases are not matched in this mode. crystal resonator/ external clock input 3 only pll circuit 2 operates. the ckio pin is high impedance. phases are not matched in this mode. crystal resonator/ external clock input 4 set this mode when the ckio pin inputs a clock having a frequency equivalent to the object operating frequency and pll circuit 1 synchronizes the phases of the input clock and the internal clock. external clock input 5 set this mode when the ckio pin inputs a clock having a frequency equivalent to the object operating frequency and pll circuit 1 shifts the phases of the input clock and internal clock by 90 degrees. external clock input 6 set this mode when a clock having a frequency equivalent to that of clocks input from the ckio pin are used . pll circuits 1 and 2 do not operate. external clock input when clock modes 0 to 3 are selected, the input frequency or its double or quadruple (produced by pll circuit 2) is used as the internal clock. when clock modes 4 to 6 are selected, the clock pause function can modify the frequency of clocks input from the ckio pin or can stop the sending of clock signals (see section 14.4, standby mode). when clock modes 4 to 6 are set, pll circuit 2 stops. table 3.3 lists the relationship between pins md2 to md0 and the clock operating mode. do not switch the md2?d0 pins while they are operating. switching will cause operating errors. .com .com .com .com 4 .com u datasheet
52 table 3.3 clock mode pin settings and states pin* 1 clock mode md2 md1 md0 ckpreq / ckm extal xtal ckio internal clock 0 000 0 1 clock input crystal oscillation open crystal oscillation output synchronized to a phase difference of 0? from ckio by pll circuit 1 1 001 0 1 clock input crystal oscillation open crystal oscillation output synchronized to a phase difference of 90? from ckio by pll circuit 1 2 010 0 1 clock input crystal oscillation open crystal oscillation output ckio 3 011 0 1 clock input crystal oscillation open crystal oscillation high impe- dance pll circuit 2 output 4 100 * 2 open open clock input synchronized to a phase difference of 0? from ckio by pll circuit 1 5 1 0 1 open open clock input synchronized to a phase difference of 90? from ckio by pll circuit 1 6 1 1 0 open open clock input ckio notes: 1. do not use in combinations other than those listed. 2. in clock modes 4, 5, and 6, ckpreq /ckm functions as the clock pause request pin. 3. for tbp-176 package products, only clock mode 4, 5, or 6 can be selected. 3.2.3 connecting a crystal resonator connecting a crystal resonator: figure 3.2 shows how to connect a crystal resonator. use the value shown in table 3.4 for the damping resistance rd. the crystal resonator should be an at-cut parallel-resonance type. be sure to connect load capacitors (cl1, cl2) as shown in the figure. .com .com .com .com 4 .com u datasheet
53 high level the ckio pin is an output in clock modes 0,1, and 2. in mode 3, it is high impedance. cl1 rd ckpreq 22 pf output or high impedance cl2 figure 3.2 example of crystal resonator connection table 3.4 damping resistance (reference values) frequency (mhz) 4 6 8 rd ( ? crystal resonator : figure 3.3 shows a crystal resonator equivalent circuit. use a crystal resonator that has the characteristics shown in table 3.5. co extal cl rs l figure 3.3 crystal resonator equivalent circuit table 3.5 crystal resonator characteristics (reference values) frequency (mhz) parameters 4 6 8 rs max ( ? .com .com .com .com 4 .com u datasheet
54 3.2.4 inputting an external clock input the external clock from the extal pin or the ckio pin, depending on the clock mode. clock input from the extal pin : this can be used in clock modes 0,1, 2, and 3. ground level the ckio pin is an output in clock modes 0,1, and 2. in mode 3, it is high impedance. ckpreq figure 3.4 inputting external clock clock input from the ckio pin : this can be used in clock modes 4, 5, and 6. ckpreq ckpreq figure 3.5 inputting external clock 3.2.5 selecting operating frequency with a register pll circuit 2 and the frequency modification register can double or quadruple the operating frequency in clock modes 0 to 3 . figure 3.6 shows a block diagram of pll circuit 2 and the frequency modification register. .com .com .com .com 4 .com u datasheet
55 oscillator pll circuit 2 f figure 3.6 relationship between pll circuit 2 and the frequency modification register pll circuit 2 includes the pll circuit (which quadruples frequency f of clocks generated by the oscillator) and frequency dividers, which divide the output of the pll circuit by 2 or 4. the clocks (f 1, f 2, and f 4) are input to the frequency selection circuit, where one is selected according to the value set in the frequency modification register, and is then output from pll circuit 2. frequency modification register : this register is only initialized by a power-on reset. it holds its values in a manual reset and in standby mode. table 3.6 shows the register configuration, and the following figure shows the bit combinations and functions. table 3.6 frequency modification register register abbrev. r/w initial value address access size frequency modification register fmr r/w h'00 h'fffffe90 8 bit: 7 6 5 4 3 2 1 0 bit name: fr1 fr0 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r/w r/w bit 1: fr1 bit 0: fr0 description 0 0 no multiplication (initial value) 1 .com .com .com .com 4 .com u datasheet
56 bits 2? are reserved. they always read 0, and the write value should always be 0. modifying frequencies : in the following modifications, the device is running in clock modes 0 to 3, and the operating frequency is left unchanged, doubled, or quadrupled using pll circuit 2. ? set the tme bit to 0 in or above the oscillation settling time that specifies the on-chip wdt? overflow time. ? set the frequency modification register to the target value. (the chip will go internally to standby mode temporarily.) ? all circuits involved in oscillation operate and the clock is supplied to the wdt. the wdt overflows with this clock. ? when the wdt overflows, a clock at the frequency set within the chip begins to be supplied and the chip returns from standby mode. frequency modification guidelines: ? only write to the frequency modification register while the cache is disabled. ? the frequency modification program is always in cache memory and so should be executed utilizing the forced access space of the data array. figure 3.7 shows how the frequency modification register is set. ? when the frequency modification program is executed, execute an associative or forced purge of the entries in the data array used. ? place at least eight consecutive nop instructions after an instruction that writes to the frequency modification register. disable cache transfer the frequency modification program to the data array execute the frequency modification program in data array forced space cache purge next program figure 3.7 frequency modification flowchart .com .com .com .com 4 .com u datasheet
57 frequency modification register setting program (sample) ; define constants clr .equ h'00000000 wait_time .equ h'00080000 purge .equ h'40000000 ; map_rom .equ h'00000000 map-io .equ h'fffff000 ; direct_rw .equ h'c0000000 mdc_flcr .equ h'fffffe90 mdc_ccr .equ h'fffffe92 wtcsr .equ h'fffffe80 ; ; program initialization mov.l #clock2_start,r0 mov.l #direct_rw,r1 mov.l #clock2_end,r11 ; cache_ccr save, disable, and forced purge mov.l #mdc_ccr,r2 mov.b @r2,r6 mov #h'00,r3 ;disable setting mov.b r3,@r2 mov.b @r2,r3 ;dummy read mov #h'10,r3 ;forced purge setting mov.b r3,@r2 ; ; transfer frequency modification program to the data array ; prg_trns ; read from the main memory mov.l @r0,r2 mov.l @(4,r0),r3 *1 mov.l @(8,r0),r4 *1 mov.l @(12,r0),r5 *1 ; write to the data array mov.l r2,@r1 .com .com .com .com 4 .com u datasheet
58 mov.l r3,@(4,r1) *1 mov.l r4,@(8,r1) *1 mov.l r5,@(12,r1) *1 ; increment pointer add #h'10,r0 add #h'10,r1 ; loop cmp/gt r11,r0 bf prg_trns ; branch to the data array forced access space mov.l #direct_rw,r0 jmp @r0 nop .const *2 ; clock2_start mov.l #next_prog,r3 ;branch destination address for the next program mov.l #wtcsr,r0 ;wdt setting mov.l #h'0000a507,r1 ;set enough time for pll to be stabilized mov.w r1,@r0 mov.l #mdc_flcr,r2 ;frequency modification register setting mov #h'01,r1 ;double the internal frequency mov.b r1,@r2 ; wait during frequency modification nop nop nop nop nop nop nop nop .com .com .com .com 4 .com u datasheet
59 nop nop nop nop nop nop nop ; branch to the next program jmp @r3 nop .const *2 clock2_end ; ; next program next_prog ; cache_ccr load mov.l #mdc_ccr,r2 mov.b r6,@r2 . . . notes: *1 this example shows hitachi cross-assembler coding. with the hitachi cross-assembler, the values to which scaling ( is returned. .com .com .com .com 4 .com u datasheet
60 3.2.6 operating modes and frequency ranges table 3.7 shows the operating modes and the associated frequency ranges for input clocks. table 3.7 operating modes and frequency ranges pll circuit clock input internal clock ckio output mode pll1 pll2 pin input frequency range (mhz) frequency (mhz) frequency (mhz) comments 0 active active extal 4 8* 1 4 max* 2 7 max* 2 multiplication 1 (including ratio settable 2 halted when resonator 4 max* 2 ( max* 2 7 max* 3 multiplication 5 not settable 6 halted 4 max* 2 4 max* 2 ( max represents the maximum operating frequency of 28.7 mhz at 5 v operation and 20.0 mhz at 3.3 v operation. 3. if ckio output below 7 mhz is used during pll circuit 1 operation, ac characteristics using the ckio output are not guaranteed. 3.2.7 notes on board design when using a crystal resonator : place the crystal resonator and capacitors as close to the extal and xtal pins as possible. do not let the pins?signal lines cross other signal lines. if they do, induction may prevent proper oscillation. .com .com .com .com 4 .com u datasheet
61 extal xtal sh7604 cl1 cl2 cl1 = cl2 = 18 pf 22 pf no crossing of signal lines figure 3.8 design considerations when using a crystal resonator when using pll oscillation circuits : place oscillation settling capacitors c1 and c2 and resistors r1 and r2 near the cap1 and cap2 pins, and keep the wiring from the cap pins as short as possible. as the cap pin circuits are susceptible to influence by other signals, avoid crossing signal lines both on the board surface and in internal layers. pll-v cc and pll-v ss should be isolated from other v cc and v ss lines away from the board's power supply sources, and bypass capacitors cpb and cb must be inserted near the pins. in the clock circuits in this product, clock stability may be affected by reflected noise generated by the ckio pin. this influence is especially great in clock modes 0 and 1, in which the pll1 and pll2 circuits are used simultaneously, so the board design should ensure that reflected noise does not occur in ckio. in clock mode 6, in which no plls are used, connect pll-v cc to v cc and pll-v ss to v ss . table 3.8 connected resistance and capacitance reference values mode setting resistance/capacitance 0123456 r1 = 3 k ? ? when the pll circuits are off, cap1 and cap2 should be left open or used as shown in the recommended example. .com .com .com .com 4 .com u datasheet
62 no crossing of signal lines (do not cross signal lines in adjacent layers on the board) cap1 sh7604 cap2 pll v cc pll v ss v cc v ss cpb rp r2 c2 r2 c2 cb note: cpb/cb: 0.1 ? figure 3.9 design considerations when using pll oscillation circuits 3.3 bus width of the cs0 area pins md3 and md4 are used to specify the bus width of the cs0 area (boot rom area) . the pin combination and functions are listed in table 3.9. do not switch the md4 and md3 pins while they are operating. switching them will cause operating errors. table 3.9 bus width of the cs0 area pin md4 md3 function 0 0 8-bit bus width selected 0 1 16-bit bus width selected 1 0 32-bit bus width selected 1 1 setting prohibited .com .com .com .com 4 .com u datasheet
63 3.4 switching between master mode and slave mode the sh7604 has two master modes and a slave mode for bus rights that can be selected with the md5 pin. the master modes consist of a total master mode and a partial-share master mode, which are specified using the md5 pin and the partial-share space specification bit (pshr) in bus control register 1 (bcr1). when the slave mode is selected with the md5 pin, the device enters total slave mode. when master mode is selected with the md5 pin and partial-space share is specified with the pshr bit, the device enters partial-share master mode. when partial-space share is not specified with the pshr bit, the device enters total master mode. total master mode has rights to bus use. external devices can be accessed freely. the bus can be allocated to another cpu upon request. total slave mode does not have any rights to bus use. when an external device is accessed, bus rights have to be requested from the master cpu, and permission to use the bus gained, before the external device can be accessed. partial-share master mode lacks bus rights only for the cs2 space. to access the cs2 space, bus rights must first be requested from the master cpu, and permission granted. this mode has bus rights for all other spaces and does not require a request for the bus when accessing them (table 3.10). do not change md5 while external device accesses are in progress. table 3.10 master modes and slave mode mode md5 total slave mode specification pin pshr partial-share bit function total slave mode 1 (not used) has no bus rights. to use the bus, it must request the bus and receive permission from the master cpu. partial-share master mode 0 1 has bus rights to cs0, cs1, and cs3 spaces, but not normally to cs2. to access cs2, it must first request and be granted bus rights. total master mode 0 0 always has bus rights. grants bus rights to slave cpus. .com .com .com .com 4 .com u datasheet
64 .com .com .com .com 4 .com u datasheet
65 section 4 exception handling 4.1 overview 4.1.1 types of exception handling and priority order exception handling is initiated by four sources: resets, address errors, interrupts, and instructions (table 4.1). when several exception handling sources occur at once, they are processed according to priority. table 4.1 types of exception handling and priority order exception source priority reset power-on reset high manual reset address cpu address error error dma address error interrupt nmi user break irl (irl1?rl15 (set with irl3 , irl2 , irl1 , irl0 pins)) on-chip peripheral modules division unit (divu) direct memory access controller (dmac) watchdog timer (wdt) compare match interrupt (part of the bus state controller) serial communication interface (sci) 16-bit free-running timer (frt) instructions trap instruction (trapa) general illegal instructions (undefined code) illegal slot instructions (undefined code placed directly following a delayed branch instruction *1 or instructions that rewrite the pc *2 ) low notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf 2. instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf .com .com .com .com 4 .com u datasheet
66 4.1.2 exception handling operations exception handling sources are detected, and exception handling started, according to the timing shown in table 4.2. table 4.2 timing of exception source detection and start of exception handling exception source timing of source detection and start of handling reset power-on reset starts when the nmi pin is high and the res pin changes from low to high. manual reset starts when the nmi pin is low and the res pin changes from low to high. address error detected when instruction is decoded and starts when the previous executing instruction finishes executing. interrupts detected when instruction is decoded and starts when the previous executing instruction finishes executing. instructions trap instruction starts from the execution of a trapa instruction. general illegal instructions starts from the decoding of undefined code anytime except after a delayed branch instruction (delay slot). illegal slot instructions starts from the decoding of undefined code placed directly following a delayed branch instruction (delay slot) or of an instruction that rewrites the pc. when exception handling starts, the cpu operates as follows: 1. exception handling triggered by reset the initial values of the program counter (pc) and stack pointer (sp) are fetched from the exception vector table (pc and sp are respectively addresses h'00000000 and h'00000004 for a power-on reset and addresses h'00000008 and h'0000000c addresses for a manual reset). see section 4.1.3, exception vector table, for more information. 0 is then written to the vector base register (vbr) and 1111 is written to the interrupt mask bits (i3?0) of the status register. the program begins running from the pc address fetched from the exception vector table. 2. exception handling triggered by address errors, interrupts, and instructions sr and pc are saved to the stack address indicated by r15. for interrupt exception handling, the interrupt priority level is written to the sr? interrupt mask bits (i3?0). for address error and instruction exception handling, the i3?0 bits are not affected. the start address is then fetched from the exception vector table and the program begins running from that address. .com .com .com .com 4 .com u datasheet
67 4.1.3 exception vector table before exception handling begins, the exception vector table must be written in memory. the exception vector table stores the start addresses of exception service routines. (the reset exception table holds the initial values of pc and sp.) all exception sources are given different vector numbers and vector table address offsets, from which the vector table addresses are calculated. during exception handling, the start addresses of the exception service routines are fetched from the exception vector table. table 4.3 lists the vector numbers and vector table address offsets. table 4.4 shows vector table address calculations. table 4.3 exception vector table exception source vector number vector table address offset vector address power-on reset pc 0 h'00000000?'00000003 vector number 4 sp 1 h'00000004?'00000007 manual reset pc 2 h'00000008?'0000000b sp 3 h'0000000c?'0000000f general illegal instruction 4 h'00000010?'00000013 vbr + (vector (reserved by system) 5 h'00000014?'00000017 number 4) slot illegal instruction 6 h'00000018?'0000001b (reserved by system) 7 h'0000001c?'0000001f 8 h'00000020?'00000023 cpu address error 9 h'00000024?'00000027 dma address error 10 h'00000028?'0000002b interrupt nmi 11 h'0000002c?'0000002f user break 12 h'00000030?'00000033 (reserved by system) 13 : 31 h'00000034?'00000037 : h'0000007c?'0000007f trap instruction (user vector) 32 : 63 h'00000080?'00000083 : h'000000fc?'000000ff .com .com .com .com 4 .com u datasheet
68 table 4.3 exception processing vector table (cont) exception source vector number vector table address offset vector addresses interrupt irl1 *1 64 *2 h'00000100?'00000103 vbr + (vector irl2 *1 65 *2 h'00000104?'00000107 number 4) irl3 *1 irl4 *1 66 *2 h'00000108?'0000010b irl5 *1 irl6 *1 67 *2 h'0000010c?'0000010f irl7 *1 irl8 *1 68 *2 h'00000110?'00000113 irl9 *1 irl10 *1 69 *2 h'00000114?'00000117 irl11 *1 irl12 *1 70 *2 h'00000118?'0000011b irl13 *1 irl14 *1 71 *2 h'0000011c?'0000011f irl15 *1 on-chip peripheral module* 3 0 *4 : 255 *4 h'00000000?'00000003 : h'000003fc?'000003ff notes: 1. when 1110 is input to the irl3 , irl2 , irl1 , and irl0 pins, an irl1 interrupt results. when 0000 is input, an irl15 interrupt results. 2. external vector number fetches can be performed without using the auto-vector numbers in this table. 3. the vector numbers and vector table address offsets for each on-chip peripheral module interrupt are given in section 5, interrupt controller, and table 5.4, interrupt exception vectors and priorities. 4. vector numbers are set in the on-chip vector number register. see section 5.3, description of registers, section 9, direct memory access controller, and section 10, division unit, for more information. .com .com .com .com 4 .com u datasheet
69 table 4.4 calculating exception vector table addresses exception source vector table address calculation power-on reset manual reset (vector table address) = (vector table address offset) = (vector number) 4 other exception handling (vector table address) = vbr + (vector table address offset) = vbr + (vector number) 4 note: vbr: vector base register vector table address offset: see table 4.3. vector number: see table 4.3. 4.2 resets 4.2.1 types of resets resets have the highest priority of any exception source. there are two types of resets: manual resets and power-on resets. as table 4.5 shows, both types of resets initialize the internal status of the cpu. in power-on resets, all registers of the on-chip peripheral modules are initialized; in manual resets, registers of all on-chip peripheral modules except the bus state controller (bsc), user break controller (ubc) and frequency modification register are initialized. (use the power-on reset when turning the power on.) table 4.5 types of resets conditions for transition to reset status internal status type nmi pin res pin cpu on-chip peripheral modules power-on reset high low initialized initialized manual reset low low initialized initialized except for bsc, ubc, and fmr register .com .com .com .com 4 .com u datasheet
70 4.2.2 power-on reset when the nmi pin is high and the res pin is driven low, the device performs a power-on reset. for a reliable reset, the res pin should be kept low for at least the duration of the oscillation settling time (when the pll circuit is halted) or for 20 clock cycles (when the pll circuit is running). during a power-on reset, the cpu? internal state and all on-chip peripheral module registers are initialized. see appendix a, pin states, for the state of individual pins in the power-on reset state. in a power-on reset, power-on reset exception handling starts when the nmi pin is kept high and the res pin is first driven low for a set period of time and then returned to high. the cpu will then operate as follows: 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception vector table. 3. the vector base register (vbr) is cleared to h'00000000 and the interrupt mask bits (i3?0) of the status register (sr) are set to h'f (1111). 4. the values fetched from the exception vector table are set in the pc and sp, and the program begins executing. 4.2.3 manual reset when the nmi pin is low and the res pin is driven low, the device executes a manual reset. for a reliable reset, the res pin should be kept low for at least 20 clock cycles. during a manual reset, the cpu? internal state is initialized. registers of all on-chip peripheral modules except the bus state controller (bsc), user break controller (ubc) and the frequency modification register are initialized. since the bsc is not affected, the dram and synchronous dram refresh control functions remain operational even if the manual reset state continues for a long period of time. when the chip enters the manual reset state in the middle of a bus cycle, manual reset exception handling does not start until the bus cycle has ended. thus, manual resets do not abort bus cycles. see appendix a, pin states, for the state of individual pins in the manual reset state. in a manual reset, manual reset exception handling starts when the nmi pin is kept low and the res pin is first kept low for a set period of time and then returned to high. the cpu will then operate in the same way as for a power-on reset. .com .com .com .com 4 .com u datasheet
71 4.3 address errors 4.3.1 sources of address errors address errors occur when instructions are fetched or data read or written, as shown in table 4.6. table 4.6 bus cycles and address errors bus cycle type bus master bus cycle description address errors instruction cpu instruction fetched from even address none (normal) fetch instruction fetched from odd address address error occurs instruction fetched from other than on-chip peripheral module space none (normal) instruction fetched from on-chip peripheral module space address error occurs data cpu or word data accessed from even address none (normal) read/write dmac word data accessed from odd address address error occurs longword data accessed from a longword boundary none (normal) longword data accessed from other than a longword boundary address error occurs access of cache purge space, address array read/ write space or on-chip i/o space by pc-relative addressing address error occurs access of cache purge space, address array read/ write space, data array read/write space or on-chip i/o space by a tas.b instruction address error occurs byte data accessed in on-chip peripheral module space at addresses h'ffffff00 to h'ffffffff address error occurs word or longword data accessed in on-chip peripheral module space at addresses h'ffffff00 to h'ffffffff none (normal) longword data accessed in on-chip peripheral module space at addresses h'fffffe00 to h'fffffeff address error occurs word or byte data accessed in on-chip peripheral module space at addresses h'fffffe00 to h'fffffeff none (normal) notes: 1. address errors do not occur during the synchronous dram mode register write cycle. 2. 16-byte dmac transfers use longword accesses. .com .com .com .com 4 .com u datasheet
72 4.3.2 address error exception handling when an address error occurs, address error exception handling begins after the end of the bus cycle in which the error occurred and completion of the executing instruction. the cpu operates as follows: 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last instruction executed . 3. the exception service routine start address is fetched from the exception vector table entry that corresponds to the address error that occurred, and the program starts executing from that address. the jump that occurs is not a delayed branch. 4.4 interrupts 4.4.1 interrupt sources table 4.7 shows the sources that initiate interrupt exception handling. these are divided into nmi, user breaks, irl, and on-chip peripheral modules. each interrupt source is allocated a different vector number and vector table address offset. see table 5.4, interrupt exception vectors and priority order, in section 5, interrupt controller, for more information. table 4.7 types of interrupt sources type request source number of sources nmi nmi pin (external input) 1 user break user break controller 1 irl irl1?rl15 (external input) 15 on-chip peripheral module direct memory access controller (dmac) 2 division unit (divu) 1 serial communication interface (sci) 4 free-running timer (frt) 3 watchdog timer (wdt) 1 bus state controller (bsc) 1 .com .com .com .com 4 .com u datasheet
73 4.4.2 interrupt priority levels the interrupt priority order is predetermined. when multiple interrupts occur simultaneously, the interrupt controller (intc) determines their relative priorities and begins exception handling accordingly. the priority order of interrupts is expressed as priority levels 0?6, with priority 0 the lowest and priority 16 the highest. the nmi interrupt has priority 16 and cannot be masked, so it is always accepted. the user break interrupt priority level is 15 and irl interrupts have priorities of 1?5. on-chip peripheral module interrupt priority levels can be set freely using the intc? interrupt priority level setting registers a and b (ipra and iprb) as shown in table 4.8. the priority levels that can be set are 0?5. level 16 cannot be set. for more information on ipra and iprb, see sections 5.3.1 and 5.3.2, interrupt priority level setting registers a and b (ipra and iprb). table 4.8 interrupt priority order type priority level comment nmi 16 fixed priority level. cannot be masked. user break 15 fixed priority level. irl 1?5 set with irl3 irl0 pins. on-chip peripheral module 0?5 set with interrupt priority level setting registers a and b (ipra and iprb). 4.4.3 interrupt exception handling when an interrupt occurs, its priority level is ascertained by the interrupt controller (intc). nmi is always accepted, but other interrupts are only accepted if they have a priority level higher than the priority level set in the interrupt mask bits (i3?0) of the status register (sr). when an interrupt is accepted, exception handling begins. in interrupt exception handling, the cpu saves sr and the program counter (pc) to the stack. the priority level value of the accepted interrupt is written to sr bits i3?0. for nmi, however, the priority level is 16, but the value set in i3?0 is h'f (level 15). next, the start address of the exception service routine is fetched from the exception vector table for the accepted interrupt, that address is jumped to and execution begins. for more information about interrupt exception handling, see section 5.4, interrupt operation. .com .com .com .com 4 .com u datasheet
74 4.5 exceptions triggered by instructions 4.5.1 instruction-triggered exception types exception handling can be triggered by a trap instruction, general illegal instruction or illegal slot instruction, as shown in table 4.9. table 4.9 types of exceptions triggered by instructions type source instruction comment trap instruction trapa illegal slot instruction undefined code placed immediately after a delayed branch instruction (delay slot) and instructions that rewrite the pc delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf general illegal instruction undefined code anywhere besides in a delay slot 4.5.2 trap instructions when a trapa instruction is executed, trap instruction exception handling starts. the cpu operates as follows: 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the trapa instruction. 3. the exception service routine start address is fetched from the exception vector table entry that corresponds to the vector number specified by the trapa instruction. that address is jumped to and the program starts executing. the jump that occurs is not a delayed branch. 4.5.3 illegal slot instructions an instruction placed immediately after a delayed branch instruction is said to be placed in a delay slot. if the instruction placed in the delay slot is undefined code, illegal slot exception handling begins when the undefined code is decoded. illegal slot exception handling also starts up when an instruction that rewrites the program counter (pc) is placed in a delay slot. the exception handling starts when the instruction is decoded. the cpu handles an illegal slot instruction as follows: .com .com .com .com 4 .com u datasheet
75 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the jump address of the delayed branch instruction immediately before the undefined code or the instruction that rewrites the pc. 3. the exception service routine start address is fetched from the exception vector table entry that corresponds to the exception that occurred. that address is jumped to and the program starts executing. the jump that occurs is not a delayed branch. 4.5.4 general illegal instructions when undefined code placed anywhere other than immediately after a delayed branch instruction (i.e., in a delay slot) is decoded, general illegal instruction exception handling starts. the cpu handles general illegal instructions in the same way as illegal slot instructions. unlike processing of illegal slot instructions, however, the program counter value stored is the start address of the undefined code. 4.6 when exception sources are not accepted when an address error or interrupt is generated after a delayed branch instruction or interrupt- disabled instruction, it is sometimes not immediately accepted but is stored instead, as described in table 4.10. when this happens, it will be accepted when an instruction for which exception acceptance is possible is decoded. table 4.10 exception source generation immediately after a delayed branch instruction or interrupt-disabled instruction exception source point of occurrence address error interrupt immediately after a delayed branch instruction *1 not accepted not accepted immediately after an interrupt-disabled instruction *2 accepted not accepted notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf 2. interrupt-disabled instructions: ldc, ldc.l, stc, stc.l, lds, lds.l, sts, sts.l 4.6.1 immediately after a delayed branch instruction when an instruction placed immediately after a delayed branch instruction (delay slot) is decoded, neither address errors nor interrupts are accepted. the delayed branch instruction and the instruction located immediately after it (delay slot) are always executed consecutively, so no exception handling occurs between the two. .com .com .com .com 4 .com u datasheet
76 4.6.2 immediately after an interrupt-disabled instruction when an instruction immediately following an interrupt-disabled instruction is decoded, interrupts are not accepted. address errors are accepted. 4.7 stack status after exception handling the status of the stack after exception handling ends is as shown in table 4.11. table 4.11 stack status after exception handling type stack status address error sp address of instruction after executed instruction 32 bits sr 32 bits trap instruction sp address of instruction after trapa instruction 32 bits sr 32 bits general illegal instruction sp start address of illegal instruction 32 bits sr 32 bits interrupt sp address of instruction after executed instruction 32 bits sr 32 bits illegal slot instruction sp jump destination address of delayed branch instruction 32 bits sr 32 bits 4.8 usage notes 4.8.1 value of stack pointer (sp) the value of the stack pointer must always be a multiple of four, otherwise an address error will occur when the stack is accessed during exception handling. 4.8.2 value of vector base register (vbr) the value of the vector base register must always be a multiple of four, otherwise an address error will occur when the vector table is accessed during exception handling. .com .com .com .com 4 .com u datasheet
77 4.8.3 address errors caused by stacking of address error exception handling if the stack pointer value is not a multiple of four, an address error will occur during stacking of the exception handling (interrupts, etc.). address error exception handling will begin as soon as the first exception handling is ended, but address errors will continue to occur. to ensure that address error exception handling does not go into an endless loop, no address errors are accepted at that point. this allows program control to be shifted to the address error exception service routine and enables error handling to be carried out. when an address error occurs during exception handling stacking, the stacking bus cycle (write) is executed. in stacking of the status register (sr) and program counter (pc), the sp is decremented by 4 for both, so the value of sp will not be a multiple of four after the stacking either. the address value output during stacking is the sp value, so the address where the error occurred is itself output. this means that the write data stacked will be undefined. 4.8.4 manual reset during register access do not initiate a manual reset during access of a bus state controller (bsc) or user break controller (ubc) register, otherwise a write error may result. .com .com .com .com 4 .com u datasheet
78 .com .com .com .com 4 .com u datasheet
79 section 5 interrupt controller (intc) 5.1 overview the interrupt controller (intc) ascertains the priority of interrupt sources and controls interrupt requests to the cpu. the intc has registers for setting the priority of each interrupt which allow the user to set the order of priority in which interrupt requests are handled. 5.1.1 features the intc has the following features: ? 16 interrupt priority levels: by setting the two interrupt-priority level registers, the priorities of on-chip peripheral module interrupts can be set at 16 levels for different request sources. ? settable vector numbers for on-chip peripheral module interrupts: two vector number setting registers enable on-chip peripheral module interrupt vector numbers to be set in the range 0 127 by interrupt source. ? the irl interrupt vector number setting method can be selected: either of two modes can be selected by a register setting: auto-vector mode in which vector numbers are determined internally, and external vector mode in which vector numbers are set externally. 5.1.2 block diagram figure 5.1 shows a block diagram of the intc. .com .com .com .com 4 .com u datasheet
80 cpu sr interrupt request com- parator priority decision logic (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) icr ipr ipra, iprb vcrwdt, vcra?crd module bus bus interface internal bus i3 i2 i1 i0 intc nmi ir3 ir0 a3?0 ivecf d7?0 ubc dmac divu frt sci wdt ref input/ output control vector number vector number vcrwdt div dmac peripheral bus ubc: user break controller icr: interrupt control register dmac: direct memory access controller ipra/b: interrupt priority level setting divu: division unit registers a and b frt: free-running timer vcrwdt: vector number setting register wdt sci: serial communication interface vcra?: vector number setting registers a? wdt: watchdog timer sr: status register ref: refresh request within bus state controller figure 5.1 intc block diagram .com .com .com .com 4 .com u datasheet
81 5.1.3 pin configuration table 5.1 shows the intc pin configuration. table 5.1 pin configuration name abbreviation i/o function nonmaskable interrupt input pin nmi i input of nonmaskable interrupt request signal level request interrupt input pins irl3 irl0 i input of maskable interrupt request signals interrupt acceptance level output pins a3?0 o in external vector mode, output an interrupt level signal when an irl interrupt is accepted external vector fetch pin ivecf o indicates external vector read cycle external vector number input pins d7?0 i input external vector number 5.1.4 register configuration the intc has the eight registers shown in table 5.2. these registers perform various intc functions including setting interrupt priority, and controlling external interrupt input signal detection. .com .com .com .com 4 .com u datasheet
82 table 5.2 register configuration name abbr. r/w initial value address access size* interrupt priority level setting register a ipra r/w h'0000 h'fffffee2 8, 16 interrupt priority level setting register b iprb r/w h'0000 h'fffffe60 8, 16 vector number setting register a vcra r/w h'0000 h'fffffe62 8, 16 vector number setting register b vcrb r/w h'0000 h'fffffe64 8, 16 vector number setting register c vcrc r/w h'0000 h'fffffe66 8, 16 vector number setting register d vcrd r/w h'0000 h'fffffe68 8, 16 vector number setting register wdt vcrwdt r/w h'0000 h'fffffee4 8, 16 vector number setting register div vcrdiv r/w h'ffffff0c 32 vector number setting register dmac0 vcrdma0 r/w h'ffffffa0 32 vector number setting register dmac1 vcrdma1 r/w h'ffffffa8 32 interrupt control register icr r/w h'8000/ h'0000* h'fffffee0 8, 16 ? undefined note: the value when the nmi pin is high is h'8000; when the nmi pin is low, it is h'0000. see the sections 9, direct memory access controller, and 10, division unit, for more information on vcrdiv, vcrdma0, and vcrdma1. 5.2 interrupt sources there are four types of interrupt sources: nmi, user breaks, irl, and on-chip peripheral modules. each interrupt has a priority expressed as a priority level (0 to 16, with 0 the lowest and 16 the highest). giving an interrupt a priority level of 0 masks it. 5.2.1 nmi interrupt the nmi interrupt has priority 16 and is always accepted. input at the nmi pin is detected by edge. use the nmi edge select bit (nmie) in the interrupt control register (icr) to select either the rising or falling edge. nmi interrupt exception handling sets the interrupt mask level bits (i3 i0) in the status register (sr) to level 15. 5.2.2 user break interrupt a user break interrupt has priority level 15 and occurs when the break condition set in the user break controller (ubc) is satisfied. user break interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to level 15. for more information about the user break interrupt, see section 6, user break controller. .com .com .com .com 4 .com u datasheet
83 5.2.3 irl interrupts irl interrupts are requested by input from pins irl3 irl0 . fifteen interrupts, irl15?rl1, can be input externally via pins irl3 irl0 . the priority levels of interrupts irl15?rl0 are 15?, respectively, and their vector numbers are 71?4. set the vector numbers with the irl interrupt vector mode select (vecmd) bit of the interrupt control register (icr) to enable external input. external input of vector numbers consists of vector numbers 0?27 from the external vector input pins (d7?0). internal vectors are called auto-vectors and vectors input externally are called external vectors. table 5.3 lists irl priority levels and auto vector numbers. when an irl interrupt is accepted in external vector mode, the irl interrupt level is output from the interrupt acceptance level output pins (a3?0). the external vector fetch pin ( ivecf ) is also asserted. the external vector number is read from pins d7?0 at this time. figures 5.2 and 5.3 show interrupt connection examples. irl interrupt exception processing sets the interrupt mask level bits (i3 to i0) in the status register (sr) to the priority level value of the irl interrupt that was accepted. table 5.3 irl interrupt priority levels and auto-vector numbers pin priority vector irl3 irl2 irl1 irl0 level number 00001571 000114 00101370 001112 01001169 010110 0110968 01118 1000767 10016 1010566 10114 1100365 11012 1110164 .com .com .com .com 4 .com u datasheet
84 sh7604 priority encoder interrupt requests vector number generator circuit 4 irl0 irl3 irl0 irl3 d7 a0 a3 ivecf rd d7 figure 5.2 example of connections for external vector mode interrupts sh7604 priority encoder interrupt requests 4 irl0 irl3 irl0 irl3 figure 5.3 example of connections for auto-vector mode interrupts figure 5.4 shows the interrupt fetch cycle for the external vector mode. during this cycle, cs0 cs3 stay high. a26?4 output undefined values. the wait pin is sampled, but programmable waits are not valid. .com .com .com .com 4 .com u datasheet
85 ckio cs0 cs3 bs a0 interrupt priority level ivecf wr rd d0 vector number input wait figure 5.4 external vector mode interrupt vector fetch cycle 5.2.4 on-chip peripheral module interrupts on-chip peripheral module interrupts are interrupts generated by the following 6 on-chip peripheral modules: ? division unit (divu) ? direct memory access controller (dmac) ? serial communication interface (sci) ? bus state controller (bsc) ? watchdog timer (wdt) ? free-running timer (frt) a different interrupt vector is assigned to each interrupt source, so the exception service routine does not have to decide which interrupt has occurred. priority levels between 0 and 15 can be assigned to individual on-chip peripheral modules in interrupt priority registers a and b (ipra and iprb). on-chip peripheral module interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to the priority level value of the on-chip peripheral module interrupt that was accepted. .com .com .com .com 4 .com u datasheet
86 5.2.5 interrupt exception vectors and priority order table 5.4 lists interrupt sources and their vector numbers, vector table address offsets and interrupt priorities. each interrupt source is allocated a different vector number and vector table address offset. vector table addresses are calculated from vector numbers and address offsets. in interrupt exception handling, the exception service routine start address is fetched from the vector table entry indicated by the vector table address. see table 4.4, calculating exception vector table addresses, for more information on this calculation. irl interrupts irl15?rl1 have interrupt priority levels of 15?, respectively. on-chip peripheral module interrupt priorities can be set freely between 0 and 15 for each module by setting interrupt priority registers a and b (ipra and iprb). the ranking of interrupt sources for ipra and iprb, however, must be the order listed under priority within ipr setting unit in table 5.4 and cannot be changed. a reset assigns priority level 0 to on-chip peripheral module interrupts. if the same priority level is assigned to two or more interrupt sources and interrupts from those sources occur simultaneously, their priority order is the default priority order indicated at the right in table 5.4. .com .com .com .com 4 .com u datasheet
87 table 5.4 interrupt exception vectors and priority order interrupt priority order priority within ipr vectors interrupt source (initial value) ipr (bit numbers) setting unit vector no. vector table address default priority nmi 16 11 vbr + (vector high user break 15 12 no. 71 *1 irl14 14 irl13 13 70 *1 irl12 12 irl11 11 69 *1 irl10 10 irl9 9 68 *1 irl8 8 irl7 7 67 *1 irl6 6 irl5 5 66 *1 irl4 4 irl3 3 65 *1 irl2 2 irl1 1 64 *1 divu ovfi 0 15 (0) ipra (15 12) 0 127 *2 low .com .com .com .com 4 .com u datasheet
88 table 5.4 interrupt exception vectors and priority order (cont) interrupt priority order priority within ipr vectors interrupt source (initial value) ipr (bit numbers) setting unit vector no. vector table address default priority dmac0 transfer end 0 15 (0) ipra (11 8) 1 0 127 *2 vbr + (vector dmac1 transfer end 0 0 127 *2 no. 15 (0) ipra (7 4) 1 0 127 *2 ref *3 cmi 0 0 127 *2 sci eri 0 15 (0) iprb (15 12) 3 0 127 *2 rxi 2 0 127 *2 txi 1 0 127 *2 tei 0 0 127 *2 frt ici 0 15 (0) iprb (11 8) 2 0 127 *2 oci 1 0 127 *2 ovi 0 0 127 *2 reserved 128 255 low notes: 1. an external vector number fetch can be performed without using the auto-vector numbers shown in this table. the external vector numbers are 0 127. 2. vector numbers are set in the on-chip vector number register. 3. ref is the refresh control unit within the bus state controller. 5.3 description of registers 5.3.1 interrupt priority level setting register a (ipra) interrupt priority level setting register a (ipra) is a 16-bit read/write register that assigns priority levels from 0 to 15 to on-chip peripheral module interrupts. ipra is initialized to h'0000 by a reset. it is not initialized in standby mode. unless otherwise specified, ?eset?refers to both power- on and manual resets throughout this manual. .com .com .com .com 4 .com u datasheet
89 bit: 15 14 13 12 11 10 9 8 bit name: divu ip3 divu ip2 divu ip1 divu ip0 dmac ip3 dmac ip2 dmac ip1 dmac ip0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: wdt ip3 wdt ip2 wdt ip1 wdt ip0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r r r r ? bits 15 to 12?ivision unit (divu) interrupt priority level (divuip3?ivuip0): these bits set the division unit (divu) interrupt priority level. there are four bits, so levels 0?5 can be set. ? bits 11 to 8?ma controller interrupt priority level (dmacip3?macip0): these bits set the dma controller (dmac) interrupt priority level. there are four bits, so levels 0?5 can be set. the same level is set for both dmac channels. when interrupts occur simultaneously, channel 0 has priority. ? bits 7 to 4?atchdog timer (wdt) interrupt priority level (wdtip3?dtip0): these bits set the watchdog timer (wdt) interrupt priority level and bus state controller (bsc) interrupt priority level. there are four bits, so levels 0?5 can be set. when wdt and bsc interrupts occur simultaneously, the wdt interrupt has priority. ? bits 3 to 0?eserved: these bits always read 0. the write value should always be 0. 5.3.2 interrupt priority level setting register b (iprb) interrupt priority level setting register b (iprb) is a 16-bit read/write register that assigns priority levels from 0 to 15 to on-chip peripheral module interrupts. iprb is initialized to h'0000 by a reset. it is not initialized in standby mode. .com .com .com .com 4 .com u datasheet
90 bit: 15 14 13 12 11 10 9 8 bit name: sciip3 sciip2 sciip1 sciip0 frtip3 frtip2 frtip1 frtip0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r ? bits 15 to 12?erial communication interface (sci) interrupt priority level (sciip3 sciip0): these bits set the serial communication interface (sci) interrupt priority level. there are four bits, so levels 0?5 can be set. ? bits 11 to 8?ree-running timer (frt) interrupt priority level (frtip3?rtip0): these bits set the free-running timer (frt) interrupt priority level. there are four bits, so levels 0?5 can be set. ? bits 7 to 0?eserved: these bits always read 0. the write value should always be 0. table 5.5 shows the relationship between on-chip peripheral module interrupts and interrupt priority level setting registers. table 5.5 interrupt request sources and ipra/iprb register bits 15 to 12 bits 11 to 8 bits 7 to 4 bits 3 to 0 ipra divu dmac0, dmac1 wdt reserved iprb sci frt reserved reserved as table 5.5 shows, two or three on-chip peripheral modules are assigned to each interrupt priority register. set the priority levels by setting the corresponding 4-bit groups (bits 15 to 12, bits 11 to 8, and bits 7 to 4) with values in the range of h'0 (0000) to h'f (1111). h'0 is interrupt priority level 0 (the lowest); h'f is level 15 (the highest). when two on-chip peripheral modules are assigned to the same bits (dmac0 and dmac1, or wdt and dram refresh control unit), those two modules have the same priority. a reset initializes ipra and iprb to h'0000. they are not initialized in standby mode. .com .com .com .com 4 .com u datasheet
91 5.3.3 vector number setting register wdt (vcrwdt) vector number setting register wdt (vcrwdt) is a 16-bit read/write register that sets the wdt interval interrupt and bsc compare match interrupt vector numbers (0?27). vcrwdt is initialized to h'0000 by a reset. it is not initialized in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: witv6 witv5 witv4 witv3 witv2 witv1 witv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bcmv6 bcmv5 bcmv4 bcmv3 bcmv2 bcmv1 bcmv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w ? bits 15, 7?eserved: these bits always read 0. the write value should always be 0. ? bits 14 to 8?atchdog timer (wdt) interval interrupt vector number (witv6?itv0): these bits set the vector number for the interval interrupt (iti) of the watchdog timer (wdt). there are seven bits, so the value can be set between 0 and 127. ? bits 6 to 0?us state controller (bsc) compare match interrupt vector number (bcmv6 bcmv0): these bits set the vector number for the compare match interrupt (cmi) of the bus state controller (bsc). there are seven bits, so the value can be set between 0 and 127. 5.3.4 vector number setting register a (vcra) vector number setting register a (vcra) is a 16-bit read/write register that sets the sci receive- error interrupt and receive-data-full interrupt vector numbers (0?27). vcra is initialized to h'0000 by a reset. it is not initialized in standby mode. .com .com .com .com 4 .com u datasheet
92 bit: 15 14 13 12 11 10 9 8 bit name: serv6 serv5 serv4 serv3 serv2 serv1 serv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: srxv6 srxv5 srxv4 srxv3 srxv2 srxv1 srxv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w ? bits 15, 7?eserved: these bits always read 0. the write value should always be 0. ? bits 14 to 8?erial communication interface (sci) receive-error interrupt vector number (serv6?erv0): these bits set the vector number for the serial communication interface (sci) receive-error interrupt (eri). there are seven bits, so the value can be set between 0 and 127. ? bits 6 to 0?erial communication interface (sci) receive-data-full interrupt vector number (srxv6?rxv0): these bits set the vector number for the serial communication interface (sci) receive-data-full interrupt (rxi). there are seven bits, so the value can be set between 0 and 127. 5.3.5 vector number setting register b (vcrb) vector number setting register b (vcrb) is a 16-bit read/write register that sets the sci transmit- data-empty interrupt and transmit-end interrupt vector numbers (0?27). vcrb is initialized to h'0000 by a reset. it is not initialized in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: stxv6 stxv5 stxv4 stxv3 stxv2 stxv1 stxv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: stev6 stev5 stev4 stev3 stev2 stev1 stev0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w .com .com .com .com 4 .com u datasheet
93 ? bits 15, 7?eserved: these bits always read 0. the write value should always be 0. ? bits 14 to 8?erial communication interface (sci) transmit-data-empty interrupt vector number (stxv6?txv0): these bits set the vector number for the serial communication interface (sci) transmit-data-empty interrupt (txi). there are seven bits, so the value can be set between 0 and 127. ? bits 6 to 0?erial communication interface (sci) transmit-end interrupt vector number (stev6?tev0): these bits set the vector number for the serial communication interface (sci) transmit-end interrupt (tei). there are seven bits, so the value can be set between 0 and 127. 5.3.6 vector number setting register c (vcrc) vector number setting register c (vcrc) is a 16-bit read/write register that sets the frt input- capture interrupt and output-compare interrupt vector numbers (0?27). vcrc is initialized to h'0000 by a reset. it is not initialized in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: ficv6 ficv5 ficv4 ficv3 ficv2 ficv1 ficv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: focv6 focv5 focv4 focv3 focv2 focv1 focv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w ? bits 15, 7?eserved: these bits always read 0. the write value should always be 0. ? bits 14 to 8?ree-running timer (frt) input-capture interrupt vector number (ficv6 ficv0): these bits set the vector number for the free-running timer (frt) input-capture interrupt (ici). there are seven bits, so the value can be set between 0 and 127. ? bits 6 to 0?ree-running timer (frt) output-compare interrupt vector number (focv6 focv0): these bits set the vector number for the free-running timer (frt) output-compare interrupt (oci). there are seven bits, so the value can be set between 0 and 127. .com .com .com .com 4 .com u datasheet
94 5.3.7 vector number setting register d (vcrd) vector number setting register d (vcrd) is a 16-bit read/write register that sets the frt overflow interrupt vector number (0?27). vcrd is initialized to h'0000 by a reset. it is not initialized in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: fovv6 fovv5 fovv4 fovv3 fovv2 fovv1 fovv0 initial value: 0 0 0 0 0 0 0 0 r/w: r r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r ? bits 15, 7??eserved: these bits always read 0. the write value should always be 0. ? bits 14 to 8?ree-running timer (frt) overflow interrupt vector number (fovv6 fovv0): these bits set the vector number for the free-running timer (frt) overflow interrupt (ovi). there are seven bits, so the value can be set between 0 and 127. tables 5.6 and 5.7 show the relationship between on-chip peripheral module interrupts and interrupt vector number setting registers. table 5.6 interrupt request sources and vector number setting registers (1) bits register 14? 6? vector number setting register wdt interval interrupt (wdt) compare-match interrupt (bsc) vector number setting register a receive-error interrupt (sci) receive-data-full interrupt (sci) vector number setting register b transmit-data-empty interrupt (sci) transmit-end interrupt (sci) vector number setting register c input-capture interrupt (frt) output-compare interrupt (frt) vector number setting register d overflow interrupt (frt) reserved .com .com .com .com 4 .com u datasheet
95 as table 5.6 shows, two on-chip peripheral module interrupts are assigned to each register. set the vector numbers by setting the corresponding 7-bit groups (bits 14 to 8 and bits 6 to 0) with values in the range of h'00 (0000000) to h'7f (1111111). h'00 is vector number 0 (the lowest); h'7f is vector number 127 (the highest). the vector table address is calculated by the following equation. vector table address = vbr + (vector number a reset initializes a vector number setting register to h'0000. they are not initialized in standby mode. table 5.7 lists functions for vector number setting registers div, dmac0, and dmac1. the vector number for div overflow interrupts is set in vcrdiv and the vector numbers for dmac transfer-end interrupts are set in vcrdma0 and vcrdma1. see sections 9, direct memory access controller, and 10, division unit, for more details. table 5.7 interrupt request sources and vector number setting registers (2) register setting function vector number setting register div (vcrdiv) overflow interrupts for division unit vector number setting register dmac0 (vcrdma0) channel 0 transfer end interrupt for dmac vector number setting register dmac1 (vcrdma1) channel 1 transfer end interrupt for dmac 5.3.8 interrupt control register (icr) icr is a 16-bit register that sets the input signal detection mode of external interrupt input pin nmi and indicates the input signal level at the nmi pin. it also sets the irl interrupt vector mode. a reset initializes icr to h'8000 or h'0000 but the standby mode does not. bit: 15 14 13 12 11 10 9 8 bit name: nmil nmie initial value: 0/1* 0 0 0 0 0 0 0 r/w: r r r r r r r r/w bit: 7 6 5 4 3 2 1 0 bit name: vecmd initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r/w note: when nmi input is high: 1; when nmi input is low: 0 .com .com .com .com 4 .com u datasheet
96 ? bit 15?mi input level (nmil): sets the level of the signal input at the nmi pin. this bit can be read to determine the nmi pin level. this bit cannot be modified. bit 15: nmil description 0 nmi input level is low 1 nmi input level is high ? bits 14 to 9?eserved: these bits always read 0. the write value should always be 0. ? bit 8?mi edge select (nmie): selects whether the falling or rising edge of the interrupt request signal to the nmi pin is detected. bit 8: nmie description 0 interrupt request is detected on falling edge of nmi input (initial value) 1 interrupt request is detected on rising edge of nmi input ? bits 7 to 1?eserved: these bits always read 0. the write value should always be 0. ? bit 0?rl interrupt vector mode select (vecmd): this bit selects auto-vector mode or external vector mode for irl interrupt vector number setting. in auto-vector mode, an internally determined vector number is set. the irl15 and irl14 interrupt vector numbers are set to 71 and the irl1 vector number is set to 64. in external vector mode, a value between 0 and 127 can be input as the vector number from the external vector number input pins (d7 d0). bit 0: vecmd description 0 auto vector mode, vector number automatically set internally (initial value) 1 external vector mode, vector number set by external input .com .com .com .com 4 .com u datasheet
97 5.4 interrupt operation 5.4.1 interrupt sequence the sequence of interrupt operations (figure 5.5) is explained below: 1. the interrupt request sources send interrupt request signals to the interrupt controller. 2. the interrupt controller selects the highest-priority interrupt among the interrupt requests sent, according to the priority levels set in interrupt priority level setting registers a and b (ipra and iprb). lower-priority interrupts are held pending. if two of these interrupts have the same priority level or if multiple interrupts occur within a single module, the interrupt with the highest default priority or the highest priority within its ipr setting unit (as indicated in table 5.4) is selected. 3. the interrupt controller compares the priority level of the selected interrupt request with the interrupt mask bits (i3?0) in the cpu? status register (sr). if the request priority level is equal to or less than the level set in i3?0, the request is held pending. if the request priority level is higher than the level in bits i3?0, the interrupt controller accepts the interrupt and sends an interrupt request signal to the cpu. 4. the cpu detects the interrupt request sent from the interrupt controller when it decodes the next instruction to be executed. instead of executing the decoded instruction, the cpu starts interrupt exception handling. 5. sr and pc are saved onto the stack. 6. the priority level of the accepted interrupt is copied to the interrupt mask level bits (i3 to i0) in the status register (sr). 7. when external vector mode is specified for the irl interrupt, the vector number is read from the external vector number input pins (d7?0). 8. the cpu reads the start address of the exception service routine from the exception vector table entry for the accepted interrupt, jumps to that address, and starts executing the program there. this jump is not a delayed branch. .com .com .com .com 4 .com u datasheet
98 no yes nmi? no yes user break? no yes level 15 interrupt? no yes i3 to i0 i0 read exception vector table i3-i0: status register interrupt mask bits. note: the vector number is only read from an external source when an external vector number is specified for the irl interrupt vector number. figure 5.5 interrupt sequence flowchart .com .com .com .com 4 .com u datasheet
99 5.4.2 stack after interrupt exception handling figure 5.6 shows the stack after interrupt exception handling. 32 bits 32 bits sr pc* address 4n 8 4n 4 4n sp note: pc: start address of next instruction after the executing instruction (return destination instruction) figure 5.6 stack after interrupt exception handling .com .com .com .com 4 .com u datasheet
100 5.5 interrupt response time table 5.8 shows the interrupt response time, which is the time from the occurrence of an interrupt request until interrupt exception handling starts and fetching of the first instruction of the interrupt service routine begins. figure 5.7 shows the pipeline when an irl interrupt is accepted. table 5.8 interrupt response time number of states item nmi peripheral module irl notes compare identified inter- rupt priority with sr mask level 25 wait for completion of sequence currently being executed by cpu x ( interrupt total: 7 + m1 + m2 + m3 10 + m1 + m2 + m3 response minimum: 10 13 maximum: 11 + 2 (m1 + m2 + m3) + m4 14 + 2 (m1 + m2 + m3) + m4 note: m1 m4 are the number of states needed for the following memory accesses m1: sr save (longword write) m2: pc save (longword write) m3: vector address read (longword read) m4: fetch of first instruction of interrupt service routine .com .com .com .com 4 .com u datasheet
101 fde mee mme ee fd f 53 interrupt accepted irl3 irl0 figure 5.7 pipeline when an irl interrupt is accepted 5.6 sampling of pins irl3 irl0 signals on interrupt pins irl3 to irl0 pass through the noise canceler before being sent by the interrupt controller to the cpu as interrupt requests. the noise canceler cancels noise that changes in short cycles. the cpu samples the interrupt requests between executing instructions. during this period, the noise canceler output changes according to the noise-eliminated pin level, so the pin level must be held until the cpu samples it. this means that interrupt sources generally must not be cleared inside interrupt routines. when an external vector is fetched, the interrupt source can also be cleared when the external vector fetch cycle is detected. figure 5.8 shows a block diagram of the interrupt response procedure. figure 5.9 shows interrupt response timing. .com .com .com .com 4 .com u datasheet
102 irl0 irl1 irl2 irl3 figure 5.8 interrupt response block diagram interrupt acceptance signal to cpu interrupt request to cpu noise canceler output cleared when interrupt is accepted irl3 irl0 figure 5.9 interrupt response timing chart .com .com .com .com 4 .com u datasheet
103 5.7 usage notes 1. do not execute module standby for modules that have the module-stop function when the possibility remains that an interrupt request may be output. 2. as shown in figure 5.10, the point at which the nmi request is cleared is the state following the decoding stage for the instruction replaced by the interrupt exception handling. fdeemmemee fde nmi request clearing timing nmi request (at fall) instruction replaced by interrupt exception handling start instruction in nmi routine figure 5.10 nmi request clearing timing 3. clearing interrupt sources: external interrupt sources: when an interrupt source is cleared by writing to an i/o address, another instruction will be executed before the write can be completed because of the write buffer. to ensure that the next instruction is executed after the write is completed, read from the same address after the write to obtain total synchronization. returning from interrupt handling with an rte instruction: figure 5.11 shows how a minimum interval of 1 cycle is required between the read instruction used for synchronization and the rte instruction. a read instruction for synchronization and a minimum of 1 instruction should thus be executed between the source clear and the rte instruction. changing the level during interrupt handling: figure 5.12 shows how a minimum interval of 4 cycles is required between the synchronization instruction and the ldc instruction when an ldc instruction is used to enable another overlapping interrupt by changing the sr value. a read instruction for synchronization and a minimum of 4 instructions should thus be executed between the source clear and the ldc instruction. .com .com .com .com 4 .com u datasheet
104 writing complete next interrupt can be accepted m e d d f f ex. mov r0,@r1 interrupt clear instruction ex. mov @r1,r0 synchronization instruction rte instruction delay slot instruction instruction at destination of return from interrupt irl3 irl0 figure 5.11 pipeline operation in return with rte writing complete next interrupt can be accepted m e d d f f ex. mov r0,@r1 interrupt clear instruction ex. mov @r1,r0 synchronization instruction ldc instruction interrupt-disable instruction ordinary instruction irl3 irl0 figure 5.12 pipeline operation when interrupts are enabled by modifying sr .com .com .com .com 4 .com u datasheet
105 on-chip interrupt sources: pipeline operation must be taken into account to ensure that the same interrupt does not occur again when the interrupt source is from an on-chip peripheral module. at least 2 cycles are required for the cpu to recognize that the interrupt is from an on- chip peripheral module. two cycles are also required for the fact that there is no longer an interrupt request to be relayed. ? returning from interrupt handling with an rte instruction: figure 5.13 shows how an extra cycle is required after the read instruction used for synchronization before interrupts are accepted, even when an rte instruction is executed. a read instruction for synchronization should thus be executed between the source clear and the rte instruction. ? changing the level during interrupt handling: figure 5.14 shows how a minimum interval of 2 cycles is required between the synchronization instruction and the ldc instruction when an ldc instruction is used to enable another overlapping interrupt by changing the sr value. a read instruction for synchronization and a minimum of 2 instructions should thus be executed between the source clear and the ldc instruction. writing complete next interrupt can be accepted m e d d f f ex. mov r0,@r1 interrupt clear instruction ex. mov @r1,r0 synchronization instruction ret instruction delay slot instruction instruction at destination of return from interrupt on-chip peripheral interrupt on-chip peripheral write min. 1 cycle on-chip peripheral read min. 1 cycle m w e e f d f d e 2 cycles m m e d f 1-cycle margin figure 5.13 pipeline operation in return with rte .com .com .com .com 4 .com u datasheet
106 writing complete next interrupt can be accepted m e d d f f ex. mov r0,@r1 interrupt clear instruction ex. mov @r1,r0 synchronization instruction ldc instruction interrupt-disable instruction ordinary instruction on-chip peripheral interrupt on-chip peripheral write min. 1 cycle on-chip peripheral read min. 1 cycle m w e f e 2 cycles 2 cycles d e f d e d f figure 5.14 pipeline operation when interrupts are enabled by changing the sr .com .com .com .com 4 .com u datasheet
107 section 6 user break controller 6.1 overview the user break controller (ubc) provides functions that simplify program debugging. break conditions are set in the ubc and a user break interrupt is generated according to the conditions of the bus cycle generated by the cpu, on-chip dmac, or external bus master. this function makes it easy to design an effective self-monitoring debugger, enabling the chip to debug programs without using an in-circuit emulator. the ubc can be set in an sh7000 series compatible mode, facilitating porting of monitoring programs that use other sh7000 series ubcs. 6.1.1 features the features of the user break controller are listed below: ? the following break compare conditions can be set: two break channels (channel a, channel b). user break interrupts can be requested using either independent or sequential condition for the two channels (sequential breaks are channel a, then channel b). ? address ? data (channel b only) ? bus master: cpu cycle/dma cycle/external bus cycle ? bus cycle: instruction fetch/data access ? read or write ? operand size: byte/word/longword ? user break interrupt generated upon satisfying break conditions. a user-designed user break interrupt exception handling routine can be run. ? select breaking in the instruction fetch cycle before the instruction is executed, or after. ? compatible with sh7000 series ubcs after a power-on reset. .com .com .com .com 4 .com u datasheet
108 6.1.2 block diagram barah baral bamrah bbra barbh barbl bamrbh bamrbl bdrbh bdrbl bdmrbh bdmrbl bbrb brcr control channel b access data address channel a access address module data bus internal data bus cache data bus access bamral internal address bus internal interrupt signal cache address bus barah/l: break address register ah/l bamrah/l: break address mask register ah/l bbra: break bus cycle register a barbh/l: break address register bh/l bamrbh/l: break address mask register bh/l bdrbh/l: break data register bh/l bdmrbh/l: break data mask register bh/l bbrb: break bus cycle register b brcr: break control register figure 6.1 user break controller block diagram .com .com .com .com 4 .com u datasheet
109 6.1.3 register configuration table 6.1 register configuration name abbr. r/w initial value* 1 address access size *2 break address register ah barah r/w h'0000 h'ffffff40 16 32 break address register al baral r/w h'0000 h'ffffff42 16 break address mask register ah bamrah r/w h'0000 h'ffffff44 16 32 break address mask register al bamral r/w h'0000 h'ffffff46 16 break bus cycle register a bbra r/w h'0000 h'ffffff48 16, 32 break address register bh barbh r/w h'0000 h'ffffff60 16 32 break address register bl barbl r/w h'0000 h'ffffff62 16 break address mask register bh bamrbh r/w h'0000 h'ffffff64 16 32 break address mask register bl bamrbl r/w h'0000 h'ffffff66 16 break data register bh bdrbh r/w h'0000 h'ffffff70 16 32 break data register bl bdrbl r/w h'0000 h'ffffff72 16 break data mask register bh bdmrbh r/w h'0000 h'ffffff74 16 32 break data mask register bl bdmrbl r/w h'0000 h'ffffff76 16 break bus cycle register b bbrb r/w h'0000 h'ffffff68 16, 32 break control register brcr r/w h'0000 h'ffffff78 16, 32 notes: 1. initialized by a power-on reset. values held in standby mode. value undefined after a manual reset. 2. byte access not permitted. sh7000 series ubc compatibility: when set in the sh7000-series-compatible mode, sh7000 series ubc registers on the sh7604 are as shown in table 6.2. table 6.2 sh7000 series and sh7604 ubcs sh7000 series sh7604 name abbr. name abbr. break address register h barh break address register ah barah break address register l barl break address register al baral break address mask register h bamrh break address mask register ah bamrah break address mask register l bamrl break address mask register al bamral break bus cycle register bbr break bus cycle register a bbra .com .com .com .com 4 .com u datasheet
110 6.2 register descriptions 6.2.1 break address register a (bara) barah: bit: 15 14 13 12 11 10 9 8 bit name: baa31 baa30 baa29 baa28 baa27 baa26 baa25 baa24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: baa23 baa22 baa21 baa20 baa19 baa18 baa17 baa16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w baral: bit: 15 14 13 12 11 10 9 8 bit name: baa15 baa14 baa13 baa12 baa11 ba10 baa9 baa8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: baa7 baa6 baa5 baa4 baa3 baa2 baa1 baa0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the two break address registers a?reak address register ah (barah) and break address register al (baral)?ogether form a single group. both are 16-bit read/write registers. barah stores the upper bits (bits 31 to 16) of the address of the channel a break condition, while baral stores the lower bits (bits 15 to 0). a power-on reset initializes both barah and baral to h'0000. their values are undefined after a manual reset. ? barah bits 15 to 0?reak address a 31 to 16 (baa31 to baa16): these bits store the upper bit values (bits 31 to 16) of the address of the channel a break condition. ? baral bits 15 to 0?reak address a 15 to 0 (baa15 to baa0): these bits store the lower bit values (bits 15 to 0) of the address of the channel a break condition. .com .com .com .com 4 .com u datasheet
111 6.2.2 break address mask register a (bamra) bamrah: bit: 15 14 13 12 11 10 9 8 bit name: bama31 bama30 bama29 bama28 bama27 bama26 bama25 bama24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bama23 bama22 bama21 bama20 bama19 bama18 bama17 bama16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bamral: bit: 15 14 13 12 11 10 9 8 bit name: bama15 bama14 bama13 bama12 bama11 bama10 bama9 bama8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bama7 bama6 bama5 bama4 bama3 bama2 bama1 bama0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the two break address mask registers a (bamra)?reak address mask register ah (bamrah) and break address mask register al (bamral)?ogether form a single group. both are 16-bit read/write registers. bamrah determines which of the bits in the break address set in barah are masked. bamral determines which of the bits in the break address set in baral are masked. a power-on reset initializes bamrah and bamral to h'0000. their values are undefined after a manual reset. ? bamrah bits 15 to 0?reak address mask a 31 to 16 (bama31 to bama16): these bits specify whether bits 31?6 (baa31 to baa16) of the channel a break address set in barah are masked. ? bamral bits 15 to 0?reak address mask a 15 to 0 (bama15 to bama0): these bits specify whether bits 15? (baa15 to baa0) of the channel a break address set in baral are masked. .com .com .com .com 4 .com u datasheet
112 bits 31 0: baman description 0 channel a break address baan is included in the break conditions (initial value) 1 channel a break address baan is masked and therefore not included in the break conditions n = 31 to 0 6.2.3 break bus cycle register a (bbra) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: cpa1 cpa0 ida1 ida0 rwa1 rwa0 sza1 sza0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the break bus cycle register a (bbra) is a 16-bit read/write register that selects the following four channel a break conditions: 1. cpu cycle/peripheral cycle 2. instruction fetch/data access 3. read/write 4. operand size a power-on reset initializes bbra to h'0000. its value is undefined after a manual reset. ? bits 15 to 8?eserved: these bits always read 0. the write value should always be 0. ? bits 7 and 6?pu cycle/peripheral cycle select a (cpa1, cpa0): these bits select whether to break channel a on a cpu and/or peripheral bus cycle. peripheral cycles are defined as on- chip dmac bus cycles, and external bus master bus cycles when the bus is released. when the peripheral cycle setting is made, on-chip dmac cycles are always included in the break conditions; however, external bus master cycles can be included or excluded, according to the setting of the ebbe bit in the brcr register. .com .com .com .com 4 .com u datasheet
113 bit 7: cpa1 bit 6: cpa0 description 0 0 no channel a user break interrupt occurs (initial value) 1 break only on cpu cycles 1 0 break only on peripheral cycles 1 break on both cpu and peripheral cycles ? bits 5 and 4?nstruction fetch/data access select a (ida1, ida0): these bits select whether to break channel a on instruction fetch and/or data access cycles. bit 5: ida1 bit 4: ida0 description 0 0 no channel a user break interrupt occurs (initial value) 1 break only on instruction fetch cycles 1 0 break only on data access cycles 1 break on both instruction fetch and data access cycles ? bits 3 and 2?ead/write select a (rwa1, rwa0): these bits select whether to break channel a on read and/or write cycles. bit 3: rwa1 bit 2: rwa0 description 0 0 no channel a user break interrupt occurs (initial value) 1 break only on read cycles 1 0 break only on write cycles 1 break on both read and write cycles ? bits 1 and 0?perand size select a (sza1, sza0): these bits select bus cycle operand size as a channel a break condition. bit 1: sza1 bit 0: sza0 description 0 0 operand size is not a break condition (initial value) 1 break on byte access 1 0 break on word access 1 break on longword access note: when breaking on an instruction fetch, set the sza0 bit to 0. all instructions are considered to be word-size accesses (instruction fetches are always longword). operand size is word for instructions or determined by the operand size specified for the cpu/dmac data access. it is not determined by the bus width of the space being accessed. .com .com .com .com 4 .com u datasheet
114 6.2.4 break address register b (barb) the channel b break address register has the same bit configuration as bara. 6.2.5 break address mask register b (bamrb) the channel b break address mask register has the same bit configuration as bamra. 6.2.6 break data register b (bdrb) bdrbh: bit: 15 14 13 12 11 10 9 8 bit name: bdb31 bdb30 bdb29 bdb28 bdb27 bdb26 bdb25 bdb24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bdb23 bdb22 bdb21 bdb20 bdb19 bdb18 bdb17 bdb16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bdrbl: bit: 15 14 13 12 11 10 9 8 bit name: bdb15 bdb14 bdb13 bdb12 bdb11 bdb10 bdb9 bdb8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bdb7 bdb6 bdb5 bdb4 bdb3 bdb2 bdb1 bdb0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the two break data registers b (bdrb)?reak data register bh (bdrbh) and break data register bl (bdrbl)?ogether form a single group. both are 16-bit read/write registers. bdrbh specifies the upper half (bits 31?6) of the data that is the break condition for channel b, while bdrbl specifies the lower half (bits 15?). a power-on reset initializes bdrbh and bdrbl to h'0000. their values are undefined after a manual reset. .com .com .com .com 4 .com u datasheet
115 ? bdrbh bits 15 to 0?reak data b 31 to 16 (bdb31 to bdb16): these bits store the upper half (bits 31?6) of the data that is the break condition for break channel b. ? bdrbl bits 15 to 0?reak data b 15 to 0 (bdb15 to bdb0): these bits store the lower half (bits 15?) of the data that is the break condition for break channel b. 6.2.7 break data mask register b (bdmrb) bdmrbh: bit: 15 14 13 12 11 10 9 8 bit name: bdmb31 bdmb30 bdmb29 bdmb28 bdmb27 bdmb26 bdmb25 bdmb24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bdmb23 bdmb22 bdmb21 bdmb20 bdmb19 bdmb18 bdmb17 bdmb16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bdmrbl: bit: 15 14 13 12 11 10 9 8 bit name: bdmb15 bdmb14 bdmb13 bdmb12 bdmb11 bdmb10 bdmb9 bdmb8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bdmb7 bdmb6 bdmb5 bdmb4 bdmb3 bdmb2 bdmb1 bdmb0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the two break data mask registers b (bdmrb)?reak data mask register bh (bdmrbh) and break data mask register bl (bdmrbl)?ogether form a single group. both are 16-bit read/write registers. bdmrbh determines which of the bits in the break address set in bdrbh are masked. bdmrbl determines which of the bits in the break address set in bdrbl are masked. a power-on reset initializes bdmrbh and bdmrbl to h'0000. their values are undefined after a manual reset. .com .com .com .com 4 .com u datasheet
116 ? bdmrbh bits 15 to 0?reak data mask b 31 to 16 (bdmb31 to bdmb16): these bits specify whether bits b 31?6 (bdb31 to bdb16) of the channel b break data set in bdrbh are masked. ? bdmrbl bits 15 to 0?reak data mask b 15 to 0 (bdmb15 to bdmb0): these bits specify whether bits b 15? (bdb15 to bdb0) of the channel b break data set in bdrbl are masked. bits 31 0: bdmbn description 0 channel b break address bit bdbn is included in the break condition (initial value) 1 channel b break address bit bdbn is masked and therefore not included in the break condition n = 31 to 0 notes: 1. when the data bus value is included in the break conditions, specify the operand size. 2. for word data, set in bits 15? of bdrb and bdmrb. for byte data, set the same data in bits 0? and bits 8?5 of bdrb and bdmrb. 3. external bus master bus cycles when the bus is released cannot be included in the data bus conditions. 6.2.8 bus break register b (bbrb) the channel b bus break register has the same bit configuration as bbra. 6.2.9 break control register (brcr) bit: 15 14 13 12 11 10 9 8 bit name: cmfca cmfpa ebbe umd pcba initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r r/w r r bit: 7 6 5 4 3 2 1 0 bit name: cmfcb cmfpb seq dbeb pcbb initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r r/w r r/w r r .com .com .com .com 4 .com u datasheet
117 the brcr register: 1. determines whether to use channels a and b as two independent channels or as sequential conditions. 2. selects sh7000 series compatible mode or sh7604 mode. 3. selects whether to break before or after instruction execution during the instruction fetch cycle. 4. enables or disables the external bus. 5. selects whether to include the data bus in channel b comparison conditions. it also has a condition-match flag that is set when conditions match. a power-on reset initializes brcr to h'0000. its value is undefined after a manual reset. ? bit 15?pu condition-match flag a (cmfca): set to 1 when cpu bus cycle conditions included in the break conditions set for channel a are met. not cleared to 0. bit 15: cmfca description 0 channel a cpu cycle conditions do not match, no user break interrupt generated (initial value) 1 channel a cpu cycle conditions have matched, user break interrupt generated ? bit 14?eripheral condition-match flag a (cmfpa): set to 1 when peripheral bus cycle conditions (on-chip dmac, or external bus cycle when external bus breaks are enabled) included in the break conditions set for channel a are met. not cleared to 0. bit 14: cmfpa description 0 channel a peripheral cycle conditions do not match, no user break interrupt generated (initial value) 1 channel a peripheral cycle conditions have matched, user break interrupt generated ? bit 13?xternal bus break enable (ebbe): monitors the external bus master's address bus when the bus is released, and includes the external bus master's bus cycle in the bus cycle select conditions (cpa1, cpb1). external bus breaks are possible in the total master mode and total slave mode. when the external bus break is enabled, set cpa1 in bbra or cpb1 in bbrb. bit 13: ebbe description 0 chip-external bus cycle not included in break conditions (initial value) 1 chip-external bus cycle included in break conditions .com .com .com .com 4 .com u datasheet
118 ? bit 12?bc mode (umd): selects sh7000 series-compatible mode or sh7604 mode. bit 12: umd description 0 compatible mode for sh7000 series ubcs (initial value) 1 sh7604 mode ? bit 11?eserved: this bit always reads 0. the write value should always be 0. ? bit 10?c break select a (pcba): selects whether to place the channel a break in the instruction fetch cycle before or after instruction execution. bit 10: pcba description 0 places the channel a instruction fetch cycle break before instruction execution (initial value) 1 places the channel a instruction fetch cycle break after instruction execution ? bits 9 and 8?eserved: these bits always read 0. the write value should always be 0. ? bit 7?pu condition-match flag b (cmfcb): set to 1 when cpu bus cycle conditions included in the break conditions set for channel b are met. not cleared to 0 (once set, it must be cleared by a write before it can be used again). bit 7: cmfcb description 0 channel b cpu cycle conditions do not match, no user break interrupt generated (initial value) 1 channel b cpu cycle conditions have matched, user break interrupt generated ? bit 6?eripheral condition-match flag b (cmfpb): set to 1 when peripheral bus cycle conditions (on-chip dmac, or external bus cycle when external bus monitoring is enabled) included in the break conditions set for channel b are met. not cleared to 0 (once set, it must be cleared by a write before it can be used again). bit 6: cmfpb description 0 channel b peripheral cycle conditions do not match, no user break interrupt generated (initial value) 1 channel b peripheral cycle conditions have matched, user break interrupt generated .com .com .com .com 4 .com u datasheet
119 ? bit 5?eserved: this bit always reads 0. the write value should always be 0. ? bit 4?equence condition select (seq): selects whether to handle the channel a and b conditions independently or sequentially. bit 4: seq description 0 channel a and b conditions compared independently (initial value) 1 channel a and b conditions compared sequentially (channel a, then channel b) ? bit 3?ata break enable b (dbeb): selects whether to include data bus conditions in the channel b break conditions. bit 3: dbeb description 0 data bus conditions not included in the channel b conditions (initial value) 1 data bus conditions included in the channel b conditions ? bit 2?nstruction break select (pcbb): selects whether to place the channel b instruction fetch cycle break before or after instruction execution. bit 2: pcbb description 0 places the channel b instruction fetch cycle break before instruction execution (initial value) 1 places the channel b instruction fetch cycle break after instruction execution ? bits 1 and 0?eserved: these bits always read 0. the write value should always be 0. .com .com .com .com 4 .com u datasheet
120 6.3 operation 6.3.1 flow of the user break operation the flow from setting of break conditions to user break interrupt exception handling is described below: 1. the break addresses are set in the break address registers (bara, barb), the masked addresses are set in the break address mask registers (bamra, bamrb), the break data is set in the break data register (bdrb), and the masked data is set in the break data mask register (bdmrb). the breaking bus conditions are set in the break bus cycle registers (bbra, bbrb). the three groups of the bbra and bbrb registers?pu cycle/peripheral cycle select, instruction fetch/data access select, and read/write select?are each set. no user break interrupt will be generated if even one of these groups is set with 00. the conditions are set in the respective bits of the brcr register. 2. when the set conditions are satisfied, the ubc sends a user break interrupt request to the interrupt controller. when conditions match, the cpu condition match flags (cmfca, cmfcb) and peripheral condition match flags (cmfpa, cmfpb) for the respective channels are set. 3. the interrupt controller checks the user break interrupt? priority level. the user break interrupt has priority level 15, so it is accepted only if the interrupt mask level in bits i3?0 in the status register (sr) is 14 or lower. when the i3?0 bit level is 15, the user break interrupt cannot be accepted but it is held pending until user break interrupt exception handling can be carried out. section 5, interrupt controller, describes the handling of priority levels in greater detail. 4. when the priority is found to permit acceptance of the user break interrupt, the cpu starts user break interrupt exception handling. 5. the appropriate condition match flag (cmfca, cmfpa, cmfcb, cmfpb) can be used to check if the set conditions match or not. the flags are set by the matching of the conditions, but they are not reset. 0 must first be written to them before they can be used again. 6.3.2 break on instruction fetch cycle 1. when cpu/instruction fetch/read/word is set in the break bus cycle registers (bbra/bbrb), the break condition becomes the cpu? instruction fetch cycle. whether it breaks before or after the execution of the instruction can then be selected for the appropriate channel with the pcba/pcbb bit in the break control register (brcr). 2. the instruction fetch cycle always fetches 32 bits (two instructions). only one bus cycle occurs, but breaks can be placed on each instruction individually by setting the respective addresses in the break address registers (bara, barb). .com .com .com .com 4 .com u datasheet
121 3. an instruction set for a break before execution breaks when it is confirmed that the instruction has been fetched and will be executed. this means this feature cannot be used on instructions fetched by overrun (instructions fetched at a branch or during an interrupt transition, but not to be executed). when this kind of break is set for the delay slot of a delayed branch instruction or an instruction following an interrupt-disabled instruction, such as ldc, the interrupt is generated prior to execution of the first instruction at which the interrupt is subsequently then accepted. 4. when the condition stipulates after execution, the instruction set with the break condition is executed and then the interrupt is generated prior to the execution of the next instruction. as with pre-execution breaks, this cannot be used with overrun fetch instructions. when this kind of break is set for a delayed branch instruction or an interrupt-disabled instruction, such as ldc, the interrupt is generated at the first instruction at which the interrupt is subsequently accepted. 5. when an instruction fetch cycle is set for channel b, break data register b (bdrb) is ignored. there is thus no need to set break data for an instruction fetch cycle break. 6.3.3 break on data access cycle 1. the memory cycles in which cpu data access breaks occur are: memory cycles from instructions, and stacking and vector reads during exception handling. these breaks cannot be used in dummy cycles for single reads of synchronous dram. 2. the relationship between the data access cycle address and the comparison condition for operand size are shown in table 6.3. this means that when address h'00001003 is set without specifying the size condition, for example, the bus cycle in which the break condition is satisfied is as follows (where other conditions are met): longword access at address h'00001000 word access at address h'00001002 byte access at address h'00001003 table 6.3 data access cycle addresses and operand size comparison conditions access size address compared longword break address register bits 31? compared with address bus bits 31? word break address register bits 31? compared with address bus bits 31? byte break address register bits 31? compared with address bus bits 31? 3. when the data value is included in the break conditions on channel b: when the data value is included in the break conditions, specify either longword, word, or byte as the operand size in the break bus cycle registers (bbra, bbrb). when data values are included in break conditions, a break interrupt is generated when the address conditions and data conditions both match. to specify byte data for this case, set the same data in the two .com .com .com .com 4 .com u datasheet
122 bytes at bits 15? and bits 7? of the break data register b (bdrb) and break data mask register b (bdmrb). when word or byte is set, bits 31?6 of bdrb and bdmrb are ignored. 6.3.4 break on external bus cycle 1. enable the external bus break enable bit (the ebbe bit in brcr) to generate a break for a bus cycle generated by the external bus master when the bus is released. external bus cycle breaks can be used in total master mode or total slave mode. 2. address and read/write can be set for external buses, but size cannot be specified. setting sizes of byte/word/longword will be ignored. also, no distinction can be made between instruction fetch and data access for external bus cycles. all cycles are considered data access cycles, so set 1 in bits ida1 and idb1 in bbra and bbrb. 3. external input of addresses uses a26?0, so set bits 31?7 of the break address registers (bara, barb) to 0, or set bits 31?7 of the break address mask registers (bamra, bamrb) to 1 to mask the addresses not input. 4. when the conditions set for the external bus cycle are satisfied, the cmfpa and cmfpb bits are set for the respective channels. 6.3.5 program counter (pc) values saved 1. break on instruction fetch (before execution): the program counter (pc) value saved to the stack in user break interrupt exception handling is the address that matches the break condition. the user break interrupt is generated before the fetched instruction is executed. if a break condition is set on an instruction that follows an interrupt-disabled instruction, however, the break occurs before execution of the instruction at which the next interrupt is accepted, so the pc value saved is the address of the break. 2. break on instruction fetch (after execution): the program counter (pc) value saved to the stack in user break interrupt exception handling is the address executed after the one that matches the break condition. the fetched instruction is executed and the user break interrupt generated before the next instruction is executed. if a break condition is set on an interrupt- disabled instruction, the break occurs before execution of the instruction at which the next interrupt is accepted, so the pc value saved is the address of the break. 3. break on data access (cpu/peripheral): the program counter (pc) value is the start address of the next instruction after the last instruction executed before the user break exception handling started. when data access (cpu/peripheral) is set as a break condition, the place where the break will occur cannot be specified exactly. the break will occur at an instruction fetched close to where the data access that is to receive the break occurs. .com .com .com .com 4 .com u datasheet
123 6.3.6 example of use break on a cpu instruction fetch bus cycle: a. register settings: bara = h'00000404, bamra = h'00000000, bbra = h'0054 barb = h'00008010, bamrb = h'00000006, bbrb = h'0054 bdrb = h'00000000, bdmrb = h'00000000 brcr = h'1400 conditions set (channel a/channel b independent mode): channel a: address = h'00000404, address mask h'00000000 bus cycle = cpu, instruction fetch (after execution), read (operand size not included in conditions) channel b: address = h'00008010, address mask h'00000006 data h'00000000, data mask h'00000000 bus cycle = cpu, instruction fetch (before execution), read (operand size not included in conditions) a user break will occur after the instruction at address h'00000404 is executed, or a user break will be generated before the execution of the instruction at address h'00008010?'00008016. b. register settings: bara = h'00037226, bamra = h'00000000, bbra = h'0056 barb = h'0003722e, bamrb = h'00000000, bbrb = h'0056 bdrb = h'00000000, bdmrb = h'00000000 brcr = h'1010 conditions set (channel a channel b sequential mode): channel a: address = h'00037226, address mask h'00000000 bus cycle = cpu, instruction fetch (before execution), read, word channel b: address = h'0003722e, address mask h'00000000 data h'00000000, data mask h'00000000 bus cycle = cpu, instruction fetch (before execution), read, word the instruction at address h'00037226 will be executed and then a user break interrupt will occur before the instruction at address h'0003722e is executed. .com .com .com .com 4 .com u datasheet
124 c. register settings: bara = h'00027128, bamra = h'00000000, bbra = h'005a barb = h'00031415, bamrb = h'00000000, bbrb = h'0054 bdrb = h'00000000, bdmrb = h'00000000 brcr = h'1000 conditions set (channel a/channel b independent mode): channel a: address = h'00027128, address mask h'00000000 bus cycle = cpu, instruction fetch (before execution), write , word channel b: address = h'00031415, address mask h'00000000 data h'00000000, data mask h'00000000 bus cycle = cpu, instruction fetch (before execution), read (operand size not included in conditions) a user break interrupt is not generated for channel a since the instruction fetch is not a write cycle. a user break interrupt is not generated for channel b because the instruction fetch is for an odd address. d. register settings: bara = h'00037226, bamra = h'00000000, bbra = h'005a barb = h'0003722e, bamrb = h'00000000, bbrb = h'0056 bdrb = h'00000000, bdmrb = h'00000000 brcr = h'1010 conditions set (channel a channel b sequential mode): channel a: address = h'00037226, address mask h'00000000 bus cycle = cpu, instruction fetch (before execution), write, word channel b: address = h'0003722e, address mask h'00000000 data h'00000000 data mask h'00000000 bus cycle = cpu, instruction fetch (before execution), read, word the break for channel a is a write cycle, so conditions are not satisfied; since the sequence conditions are not met, no user break interrupt occurs. .com .com .com .com 4 .com u datasheet
125 break on cpu data access cycle: register settings: bara = h'00123456, bamra = h'00000000, bbra = h'0064 barb = h'000abcde, bamrb = h'000000ff, bbrb = h'006a bdrb = h'0000a512, bdmrb = h'00000000 brcr = h'1008 conditions set (channel a/channel b independent mode): channel a: address = h'00123456, address mask h'00000000 bus cycle = cpu, data access, read (operand size not included in conditions) channel b: address = h'000abcde, address mask h'000000ff data h'0000a512, data mask h'00000000 bus cycle = cpu, data access, write, word for channel a, a user break interrupt occurs when it is read as longword at address h'00123454, as word at address h'00123456 or as byte at address h'00123456. for channel b, a user break interrupt occurs when h'a512 is written as word at h'000abc00?'000abcfe. break on dmac data access cycle: register settings: bara = h'00314156, bamra = h'00000000, bbra = h'0094 barb = h'00055555, bamrb = h'00000000, bbrb = h'00a9 bdrb = h'00007878, bdmrb = h'00000f0f brcr = h'1008 conditions set (channel a/channel b independent mode): channel a: address = h'00314156, address mask h'00000000 bus cycle = dma, instruction fetch, read (operand size not included in conditions) channel b: address = h'00055555, address mask h'00000000 data h'00007878, data mask h'00000f0f bus cycle = peripheral, data access, write, byte for channel a, a user break interrupt does not occur, since no instruction fetch occurs in the dmac cycle. for channel b, a user break interrupt occurs when the dmac writes h'7* (where * means don? care) as byte at h'00055555. .com .com .com .com 4 .com u datasheet
126 6.3.7 usage notes 1. ubc registers can only be read or written to by the cpu. 2. when set for a sequential break, conditions match when a match of channel b conditions occurs some time after the bus cycle in which a channel a match occurs. this means that the conditions will not be satisfied when set for a bus cycle in which channel a and channel b occur simultaneously. since the cpu uses a pipeline structure, the order of the instruction fetch cycle and memory cycle is fixed, so sequential conditions will be satisfied when the respective channel conditions are met in the order the bus cycles occur. 3. when set for sequential conditions (the seq bit in brcr is 1) and the instruction fetch cycle of the channel a cpu is set as a condition, set channel a for before instruction execution (pcba bit in brcr is 0). 4. when register settings are changed, the write values usually become valid after three cycles. for on-chip memory, instruction fetches get two instructions simultaneously. if a break condition is set on the fetch of the second of these two instructions but the contents of the ubc registers are changed so as to alter the break condition immediately after the first of the two instructions is fetched, a user break interrupt will still occur before the second instruction. to ensure the timing of the change in the setting, read the register written last as a dummy. the changed settings will be valid thereafter. 5. when a user break interrupt is generated upon a match of the instruction fetch condition and the conditions match again in the ubc while the exception handling service routine is executing, the break will cause exception handling when the i3?0 bits in sr are set to 14 or lower. when masking addresses, when setting instruction fetch and after-execution as break conditions, and when executing in steps, the ubc? exception service routine should not cause a match of addresses with the ubc. 6. when the emulator is used, the ubc is used on the emulator system side to implement the emulator's break function. this means none of the ubc functions can be used when the emulator is being used. .com .com .com .com 4 .com u datasheet
127 6.3.8 sh7000 series compatible mode 1. in sh7000 series compatible mode: in sh7000 series compatible mode, functions are as follows: ? the registers shown in the table 6.2 are valid; all others are not. ? external bus breaks are not possible in sh7000 series compatible mode. the instruction fetch cycle occurs prior to instruction execution. the flags are not set when break conditions match. 2. differences between sh7000 series compatible mode and sh7604 mode: when set for the cpu instruction fetch cycle in the sh7000 series compatible mode, the break occurs before the instruction that matches the conditions. the break conditions differ as shown below from setting for before-execution in sh7604 mode. for data access cycles, the address is always compared to 32 bits in the sh7000 series compatible mode, but in sh7604 mode is compared as shown in table 6.3. this produces the differences in break conditions shown in table 6.4. table 6.4 differences in break conditions match determination sh7000 series compatible mode sh7604 mode conditions match when set for instruction fetch cycle/before-execution breaks if instruction is overrun-fetched and not executed (as during branching) does not break if instruction is overrun fetched and not executed (as during branching) conditions match in longword access when set for addresses other than longword boundaries (4n address) does not break breaks conditions match in word access when set for addresses other than word boundaries (2n addresses) does not break breaks .com .com .com .com 4 .com u datasheet
128 .com .com .com .com 4 .com u datasheet
129 section 7 bus state controller (bsc) 7.1 overview the bus state controller (bsc) manages the address spaces and outputs control signals so that optimum memory accesses can be made in the four spaces. this enables memories like dram, synchronous dram and pseudo-sram, and peripheral chips, to be linked directly. 7.1.1 features the bsc has the following features: ? address space is divided into four spaces ? a maximum linear 32 mbytes for each of the address spaces cs0?s3 ? the type of memory connected can be specified for each space (dram, synchronous dram, pseudo-sram, burst rom, etc.). ? bus width can be selected for each space (8, 16, or 32 bits). ? wait state insertion can be controlled for each space. ? outputs control signals for each space. ? cache ? cache areas and cache-through areas can be selected by access address. ? when a cache access misses, 16 bytes are read consecutively in 4-byte units (because of cache fill); writes use the write-through system. ? cache-through accesses are accessed according to access size. ? refresh ? supports cas-before-ras refresh (auto-refresh) and self-refresh. ? refresh interval can be set using the refresh counter and clock selection. ? direct interface to dram ? multiplexes row/column address output. ? burst transfer during reads, high-speed page mode for consecutive accesses. ? generates a tp cycle to ensure ras precharge time. ? direct interface to synchronous dram ? multiplexes row/column address output. ? burst read, single write ? bank active mode .com .com .com .com 4 .com u datasheet
130 ? master and slave modes (bus arbitration) ? total master and partial-share master modes. in total master mode, all resources are shared with other cpus. bus permission is shared when an external bus release request is received. in partial-share master mode, only the cs2 space is shared with other cpus; all other spaces can be accessed at any time. ? in slave mode, the external bus is accessed when a bus use request is output and bus use permission is received. ? refresh counter can be used as an interval timer ? interrupt request generated upon compare match (cmi interrupt request signal). 7.1.2 block diagram figure 7.1 shows the bsc block diagram. .com .com .com .com 4 .com u datasheet
131 bcr1 bcr2 area control unit mcr bsc rtcsr rtcnt rtcor comparator memory control unit wcr wait control unit wait cs3 cs0 bs rd cas ras rd/ wr we3 we0 cke ivecf interrupt controller peripheral bus module bus internal bus bus interface cmi interrupt request wcr: wait control register rtcnt: refresh timer counter bcr: bus control register rtcor: refresh time constant register mcr: individual memory control register rtcsr: refresh timer control/status register figure 7.1 bsc block diagram .com .com .com .com 4 .com u datasheet
132 7.1.3 pin configuration table 7.1 lists the bus state controller pin configuration. table 7.1 pin configuration signal i/o with bus released description a26?0 i/o i address bus. 27 bits are available to specify a total 128 mbytes of memory space. the most significant 2 bits are used to specify the cs space, so the size of the spaces is 32 mbytes. when the bus is released, these become inputs for the external bus cycle address monitor. d31?0 i/o hi-z 32-bit data bus. when reading or writing a 16-bit width area, use d15?0; when reading or writing a 8-bit width area, use d7?0. with 8-bit accesses that read or write a 32-bit width area, input and output the data via the byte position determined by the lower address bits of the 32-bit bus. bs i/o i indicates start of bus cycle or monitor. with the basic interface (device interfaces except for dram, synchronous dram, pseudo- sram), signal is asserted for a single clock cycle simultaneous with address output. the start of the bus cycle can be determined by this signal. this signal is asserted for 1 cycle synchronous with column address output in dram, synchronous dram and pseudo- sram accesses. when the bus is released, bs becomes an input for address monitoring of external bus cycles. cs0 cs3 o hi-z chip select. signals that select area; specified by a26 and a25. rd/ wr , we i/o i read/write signal. signal that indicates access cycle direction (read/write). connected to we pin when dram/synchronous dram is connected. when the bus is released, becomes an input for address monitoring of external bus cycles. ras , ce o hi-z ras pin for dram/synchronous dram. ce pin for pseudo-sram. cas , oe o hi-z open when using dram. cas pin for synchronous dram. oe pin for pseudo-sram. cashh , dqmuu, we3 o hi-z when dram is used, connected to cas pin for the most significant byte (d31?24). when synchronous dram is used, connected to dqm pin for the most significant byte. when pseudo- sram is used, connected to we pin for the most significant byte. for basic interface, indicates writing to the most significant byte. cashl , dqmul, we2 o hi-z when dram is used, connected to cas pin for the second byte (d23?16). when synchronous dram is used, connected to dqm pin for the second byte. when pseudo-sram is used, connected to we pin for the second byte. for basic interface, indicates writing to the second byte. .com .com .com .com 4 .com u datasheet
133 table 7.1 pin configuration (cont) signal i/o with bus released description caslh , dqmlu, we1 o hi-z when dram is used, connected to cas pin for the third byte (d15?8). when synchronous dram is used, connected to dqm pin for the third byte. when pseudo-sram is used, connected to we pin for the third byte. for basic interface, indicates writing to the third byte. casll , dqmll, we0 o hi-z when dram is used, connected to cas pin for the least significant byte (d7?0). when synchronous dram is used, connected to dqm pin for the least significant byte. when pseudo-sram is used, connected to we pin for the least significant byte. for basic interface, indicates writing to the least significant byte. rd o hi-z read pulse signal (read data output enable signal). normally, connected to the device? /oe pin; when there is an external data buffer, the read cycle data can only be output when this signal is low. wait i ignore hardware wait input. back , brls i i bus use enable input in partial-share master or slave mode: back . bus release request input in total master: brls . breq , bgr o o bus request output in partial-share master or slave mode: breq . bus grant output in total master: bgr . cke o o synchronous dram clock enable control. signal for supporting synchronous dram self-refresh. ivecf o hi-z interrupt vector fetch. dreq0 i i dma request 0. dack0 o o dma acknowledge 0. dreq1 i i dma request 1. dack1 o o dma acknowledge 1. note: hi-z: high impedance .com .com .com .com 4 .com u datasheet
134 7.1.4 register configuration the bsc has seven registers. these registers are used to control wait states, bus width, interfaces with memories like dram, synchronous dram, pseudo-sram, and burst rom, and dram, synchronous dram, and pseudo-sram refreshing. the register configurations are shown in table 7.2. the size of the registers themselves is 16 bits. if read as 32 bits, the upper 16 bits are 0. in order to prevent writing mistakes, 32-bit writes are accepted only when the value of the upper 16 bits of the write data is h'a55a; no other writes are performed. initialize the reserved bits. initialization procedure: do not access a space other than cs0 until the settings for the interface to memory are completed. table 7.2 register configuration name abbr. r/w initial value address* 1 access size bus control register 1 bcr1 r/w h'03f0 h'ffffffe0 16 *2 , 32 bus control register 2 bcr2 r/w h'00fc h'ffffffe4 16 *2 , 32 wait control register wcr r/w h'aaff h'ffffffe8 16 *2 , 32 individual memory control register mcr r/w h'0000 h'ffffffec 16 *2 , 32 refresh timer control/status register rtcsr r/w h'0000 h'fffffff0 16 *2 , 32 refresh timer counter rtcnt r/w h'0000 h'fffffff4 16 *2 , 32 refresh time constant register rtcor r/w h'0000 h'fffffff8 16 *2 , 32 notes: 1. this address is for 32-bit accesses; for 16-bit accesses add 2. 2. 16-bit access is for read only. 7.1.5 address map the sh7604 address map, which has a memory space of 256 mbytes, is divided into four spaces . the types and data width of devices that can be connected are specified for each space . the overall space address map is shown in table 7.3 . since the spaces of the cache area and the cache- through area are the same, the maximum memory space that can be connected is 128 mbytes. this means that when address h'20000000 is accessed in a program, the data accessed is actually in h'00000000. there are several spaces for cache control. these include the associative purge space for cache purges, address array read/write space for reading and writing addresses (address tags), and data array read/write space for forced reads and writes of data arrays. .com .com .com .com 4 .com u datasheet
135 table 7.3 address map address space memory size h'00000000 to h'01ffffff cs0 space, cache area ordinary space or burst rom 32 mbytes h'02000000 to h'03ffffff cs1 space, cache area ordinary space 32 mbytes h'04000000 to h'05ffffff cs2 space, cache area ordinary space or synchronous dram 32 mbytes h'06000000 to h'07ffffff cs3 space, cache area ordinary space, synchronous dram, dram or pseudo-dram 32 mbytes h'08000000 to h'1fffffff reserved h'20000000 to h'21ffffff cs0 space, cache- through area ordinary space or burst rom (32 mbytes) h'22000000 to h'23ffffff cs1 space, cache- through area ordinary space (32 mbytes) h'24000000 to h'25ffffff cs2 space, cache- through area ordinary space or synchronous dram (32 mbytes) h'26000000 to h'27ffffff cs3 space, cache- through area ordinary space, synchronous dram, dram or pseudo-dram (32 mbytes) h'28000000 to h'3fffffff reserved h'40000000 to h'47ffffff associative purge space 128 mbytes h'48000000 to h'5fffffff reserved h'60000000 to h'7fffffff address array, read/write space 512 mbytes h'80000000 to h'bfffffff reserved h'c0000000 to h'c0000fff data array, read/write space 4 kbytes h'c0001000 to h'dfffffff reserved h'e0001000 to h'ffff7fff reserved h'ffff8000 to h'ffffbfff for setting synchronous dram mode 16 kbytes h'ffffc000 to h'fffffdff reserved 15.5 kbytes h'fffffe00 to h'ffffffff on-chip peripheral modules 512 bytes note: do not access reserved spaces, as this will cause operating errors. .com .com .com .com 4 .com u datasheet
136 7.2 description of registers 7.2.1 bus control register 1 (bcr1) bit: 15 14 13 12 11 10 9 8 bit name: master endian bstrom pshr ahlw1 ahlw0 initial value: 0 0 0 0 0 1 1 r/w: r r r r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: a1lw1 a1lw0 a0lw1 a0lw0 dram2 dram1 dram0 initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w r r/w r/w r/w initialize endian, bstrom, pshr and dram2?ram0 bits after a power-on reset and do not write to them thereafter. to change other bits by writing to them, write the same value as they are initialized to. do not access any space other than cs0 until the register initialization ends. ? bit 15?us arbitration (master): the master bit is used to check the settings of the bus arbitration function set by the mode settings with the external input pin. it is a read-only bit. bit 15 (master) description 0 master mode 1 slave mode ? bits 14, 13, and 3?eserved bits: these bits always read 0. the write value should always be 0. ? bit 12?ndian specification for area 2 (endian): in big-endian format, the msb of byte data is the lowest byte address and byte data goes in order toward the lsb . for little-endian format, the lsb of byte data is the lowest byte address and byte data goes in order toward the msb . when this bit is 1, the data is rearranged into little-endian format before transfer when the cs2 space is read or written to. it is used when handling data with little-endian processors or running programs written with little-endian format in mind. bit 12: endian description 0 big-endian, as in other areas (initial value) 1 little-endian .com .com .com .com 4 .com u datasheet
137 ? bit 11?rea 0 burst rom enable (bstrom) bit 11: bstrom description 0 area 0 is accessed normally (initial value) 1 area 0 is accessed as burst rom ? bit 10?artial space share specification (pshr): when bus arbitration is in master mode and the pshr bit is 1, only area 2 is handled as a shared space . when areas other than area 2 are accessed, bus ownership is not requested . when this bit is 1, address monitor specification is disabled . this mode is called partial-share master mode . the initial value is 0. ? bits 9 and 8?ong wait specification for areas 2 and 3 (ahlw1, ahlw0): when the basic memory interface setting is made for area 2 and area 3, the wait specification of this field is effective when the bits that specify the respective area waits in the wait control register (w21/w20 or w31/w30) specify long waits (i.e., 11). bit 9: ahlw1 bit 8: ahlw0 description 0 0 3 waits 1 4 waits 1 0 5 waits 1 6 waits (initial value) ? bits 7 and 6?ong wait specification for area 1 (a1lw1, a1lw0): when the basic memory interface setting is made for area 1, the wait specification of this field is effective when the bits that specify the wait in the wait control register specify long wait (i.e., 11). bit 7: a1lw1 bit 6: a1lw0 description 0 0 3 waits 1 4 waits 1 0 5 waits 1 6 waits (initial value) ? bits 5 and 4?ong wait specification for area 0 (a0lw1, a0lw0): when the basic memory interface setting is made for area 0, the wait specification of this field is effective when the bits that specify the wait in the wait control register specify long wait (i.e., 11). .com .com .com .com 4 .com u datasheet
138 bit 5: a0lw1 bit 4: a0lw0 description 0 0 3 waits (initial value) 1 4 waits 1 0 5 waits 1 6 waits ? bits 2 to 0?nable for dram and other memory (dram2?ram0) dram2 dram1 dram0 description 0 0 0 areas 2 and 3 are ordinary spaces (initial value) 1 area 2 is ordinary space; area 3 is synchronous dram space 1 0 area 2 is ordinary space; area 3 is dram space 1 area 2 is ordinary space; area 3 is pseudo-sram space 1 0 0 area 2 is synchronous dram space, area 3 is ordinary space 1 areas 2 and 3 are synchronous dram spaces 1 0 reserved (do not set) 1 reserved (do not set) 7.2.2 bus control register 2 (bcr2) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: a3sz1 a3sz0 a2sz1 a2sz0 a1sz1 a1sz0 initial value: 1 1 1 1 1 1 0 0 r/w: r/w r/w r/w r/w r/w r/w r r initialize bcr2 after a power-on reset and do not write to it thereafter. when writing to it, write the same values as those the bits are initialized to. do not access any space other than cs0 until the register initialization ends. .com .com .com .com 4 .com u datasheet
139 ? bits 15 to 8?eserved: these bits always read 0. the write value should always be 0. ? bits 7 and 6?us size specification for area 3 (a3sz1?3sz0). effective only when ordinary space is set. bit 7: a3sz1 bit 6: a3sz0 description 0 0 reserved (do not set) 1 byte (8-bit) size 1 0 word (16-bit) size 1 longword (32-bit) size (initial value) ? bits 5 and 4?us size specification for area 2 (a2sz1?2sz0): effective only when ordinary space is set. bit 5: a2sz1 bit 4: a2sz0 description 0 0 reserved (do not set) 1 byte (8-bit) size 1 0 word (16-bit) size 1 longword (32-bit) size (initial value) ? bits 3 and 2?us size specification for area 1 (a1sz1?1sz0) bit 3: a1sz1 bit 2: a1sz0 description 0 0 reserved (do not set) 1 byte (8-bit) size 1 0 word (16-bit) size 1 longword (32-bit) size (initial value) ? bits 1 and 0?eserved: these bits always read 0. the write value should always be 0. note: the bus size of area 0 is specified by the mode input pins. .com .com .com .com 4 .com u datasheet
140 7.2.3 wait control register (wcr) bit: 15 14 13 12 11 10 9 8 bit name: iw31 iw30 iw21 iw20 iw11 iw10 iw01 iw00 initial value: 1 0 1 0 1 0 1 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: w31 w30 w21 w20 w11 w10 w01 w00 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w do not access a space other than cs0 until the settings for register initialization are completed. ? bits 15 to 8?dles between cycles for areas 3 to 0 (iw31?w00): these bits specify idle cycles inserted between consecutive accesses to different areas. idles are used to prevent data conflict between rom or the like, which is slow to turn the read buffer off, and fast memories and i/o interfaces. even when access is to the same area, idle cycles must be inserted when a read access is followed immediately by a write access. the idle cycles to be inserted comply with the specification for the previously accessed area . iw31, iw21, iw11, iw01 iw30, iw20, iw10, iw00 description 0 0 no idle cycle 1 one idle cycle inserted 1 0 two idle cycles inserted ( initial value) 1 reserved (do not set) ? bits 7 to 0?ait control for areas 3 to 0 (w31?00) during the basic cycle: w31, w21, w11, w01 w30, w20, w10, w00 description 0 0 external wait input disabled without wait 0 1 external wait input enabled with one wait 1 0 external wait input enabled with two waits 1 1 complies with the long wait specification of bus control register 1 (bcr1). external wait input is enabled (initial value) .com .com .com .com 4 .com u datasheet
141 when area 3 is dram, the number of cas assert cycles is specified by wait control bits w31 and w30: bit 7: w31 bit 6: w30 description 0 0 1 cycle 1 2 cycles 1 0 3 cycles 1 reserved (do not set) when the setting is for 2 or more cycles, external wait input is enabled. when area 2 or 3 is synchronous dram, cas latency is specified by wait control bits w31 and w30, and w21 and w20, respectively: w31, w21 w30, w20 description 0 0 1 cycle 1 2 cycles 1 0 3 cycles 1 4 cycles with synchronous dram, external wait input is ignored regardless of any setting. when area 3 is pseudo-sram, the number of cycles from bs signal assertion to the end of the cycle is specified by wait control bits w31 and w30: bit 7: w31 bit 6: w30 description 0 0 2 cycles 1 3 cycles 1 0 4 cycles 1 reserved (do not set) when the setting is for 3 or more cycles, external wait input is enabled. .com .com .com .com 4 .com u datasheet
142 7.2.4 individual memory control register (mcr) bit: 15 14 13 12 11 10 9 8 bit name: trp rcd trwl tras1 tras0 be rasd initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r bit: 7 6 5 4 3 2 1 0 bit name: amx2 sz amx1 amx0 rfsh rmd initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r r the trp, rcd, trwl, tras1?ras0, be, rasd, amx2?mx0 and sz bits are initialized after a power-on reset. do not write to them thereafter. when writing to them, write the same values as they are initialized to. do not access any space other than cs2 and cs3 until the register initialization ends. ? bit 15?as precharge time (trp): when dram is connected, specifies the minimum number of cycles after ras is negated before the next assert. when pseudo-sram is connected, specifies the minimum number of cycles after ce is negated before the next assert. when synchronous dram is connected, specifies the minimum number of cycles after precharge until a bank active command is output. see section 7.5, synchronous dram interface, for details. bit 15: trp description 0 1 cycle (initial value) 1 2 cycles ? bit 14?as-cas delay (rcd): when dram is connected, specifies the number of cycles after ras is asserted before cas is asserted. when pseudo-sram is connected, specifies the number of cycles after ce is asserted before bs is asserted. when synchronous dram is connected, specifies the number of cycles after a bank active (actv) command is issued until a read or write command (read, reada, writ, writa) is issued. bit 14: rcd description 0 1 cycle (initial value) 1 2 cycles .com .com .com .com 4 .com u datasheet
143 ? bit 13?rite-precharge delay (trwl): when the synchronous dram is not in the bank active mode, this bit specifies the number of cycles between the write cycle and the start-up of the auto-precharge. the timing from this point to the point at which the next command can be issued is calculated within the bus state controller. in bank active mode, this bit specifies the period for which the precharge command is disabled after the write command (writ) is issued. this bit is ignored when memory other than synchronous dram is connected. bit 13: trwl description 0 1 cycle (initial value) 1 2 cycles ? bits 12 and 11?as-before-ras refresh ras assert time (tras1?ras0): the ras assertion width for dram is tras; the oe width for pseudo-sram is tras + 1 cycle. after an auto-refresh command is issued, the synchronous dram does not issue a bank active command for tras + 2 cycles, regardless of the trp bit setting. for synchronous drams, there is no ras assertion period, but there is a limit for the time from the issue of a refresh command until the next access. this value is set to observe this limit. commands are not issued for tras + 1 cycle when self-refresh is cleared. bit 12: tras1 bit 11: tras0 description 0 0 2 cycles (initial value) 1 3 cycles 1 0 4 cycles 1 reserved (do not set) ? bit 10?urst enable (be) bit 10: be description 0 burst disabled (initial value) 1 high-speed page mode during dram interfacing is enabled . data is continuously transferred in static column mode during pseudo-sram interfacing. during synchronous dram access, burst operation is always enabled regardless of this bit. .com .com .com .com 4 .com u datasheet
144 ? bit 9?as down mode (rasd) bit 9: rasd description 0 for dram, ras is negated after access ends (normal operation). for synchronous dram, a read or write is performed using auto- precharge mode . the next access always starts with a bank active command. 1 for dram, after access ends ras down mode is entered in which ras is left asserted. when using this mode with an external device connected which performs writes other than to dram, see section 7.6.5, burst access. for synchronous dram, access ends in the bank active state. this is only valid for area 3. when area 2 is synchronous dram, the mode is always auto-precharge. ? bits 7, 5, and 4?ddress multiplex (amx2?mx0) for dram interface: bit 7: amx2 bit 5: amx1 bit 4: amx0 description 0 0 0 8-bit column address dram 1 9-bit column address dram 1 0 10-bit column address dram 1 11-bit column address dram 1 0 0 reserved (do not set) 1 reserved (do not set) 1 0 reserved (do not set) 1 reserved (do not set) .com .com .com .com 4 .com u datasheet
145 for synchronous dram interface: bit 7: amx2 bit 5: amx1 bit 4: amx0 description 0 0 0 16-mbit dram (1m 16 bits) 1 16-mbit dram (2m 8 bits)* 1 0 16-mbit dram (4m 4 bits)* 1 4-mbit dram (256k 16 bits) 1 0 0 reserved (do not set) 1 reserved (do not set) 1 0 reserved (do not set) 1 2-mbit dram (128k 16 bits) note: reserved. do not set when sz bit in mcr is 0 (16-bit bus width). ? bit 6?emory data size (sz): for synchronous dram, dram, and pseudo-sram space, the data bus width of bcr2 is ignored in favor of the specification of this bit. bit 6: sz description 0 word (initial value) 1 longword ? bit 3?efresh control (rfsh): this bit determines whether or not the refresh operation of dram/synchronous dram/pseudo-sram is performed . this bit is not valid in the slave mode and is always handled as 0. bit 3: rfsh description 0 no refresh (initial value) 1 refresh ? bit 2?efresh mode (rmode): when the rfsh bit is 1, this bit selects normal refresh or self-refresh. when the rfsh bit is 0, do not set this bit to 1. when the rfsh bit is 1, self- refresh mode is entered immediately after the rmd bit is set to 1. when the rfsh bit is 1 and this bit is 0, a cas-before-ras refresh or auto-refresh is performed at the interval set in the 8- bit interval timer. when a refresh request occurs during an external area access, the refresh is performed after the access cycle is completed. when set for self-refresh, self-refresh mode is entered immediately unless the sh7604 is in the middle of an synchronous dram or pseudo- sram area access. if it is, self-refresh mode is entered when the access ends. refresh requests from the interval timer are ignored during self-refresh. self-refresh is not supported for dram, so always set rmd to 0 when using dram. .com .com .com .com 4 .com u datasheet
146 bit 2: rmode description 0 normal refresh (initial value) 1 self-refresh ? bits 8, 1, and 0?eserved: these bits always read 0. 7.2.5 refresh timer control/status register (rtcsr) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: cmf cmie cks2 cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r r r ? bits 15 to 8?eserved: these bits always read 0. ? bit 7?ompare match flag (cmf): this status flag, which indicates that the values of rtcnt and rtcor match, is set/cleared under the following conditions: bit 7: cmf description 0 rtcnt and rtcor match clear condition: after rtcsr is read when cmf is 1, 0 is written in cmf 1 rtcnt and rtcor do not match set condition: rtcnt = rtcor ? bit 6?ompare match interrupt enable (cmie): enables or disables an interrupt request caused by the cmf bit of rtscr when cmf is set to 1. bit 6: cmie description 0 interrupt request caused by cmf is disabled (initial value) 1 interrupt request caused by cmf is enabled .com .com .com .com 4 .com u datasheet
147 ? bits 5 to 3?lock select bits (cks2?ks0) bit 5: cks2 bit 4: cks1 bit 3: cks0 description 0 0 0 count-up disabled (initial value) 1 clk/4 1 0 clk/16 1 clk/64 1 0 0 clk/256 1 clk/1024 1 0 clk/2048 1 clk/4096 ? bits 2 to 0?eserved: these bits always read 0. the write value should always be 0. 7.2.6 refresh timer counter (rtcnt) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the 8-bit counter rtcnt counts up with input clocks. the clock select bit of rtcsr selects an input clock. rtcnt values can always be read/written by the cpu. when rtcnt matches rtcor, rtcnt is cleared. returns to 0 after it counts up to 255. ? bits 15 to 8?eserved: these bits always read 0. the write value should always be 0. .com .com .com .com 4 .com u datasheet
148 7.2.7 refresh time constant register (rtcor) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w rtcor is an 8-bit read/write register. the values of rtcor and rtcnt are constantly compared. when the values correspond, the compare match flag in rtcsr is set and rtcnt is cleared to 0. when the refresh bit (rfsh) in the individual memory control register is set to 1, a refresh request signal occurs. the refresh request signal is held until refresh operation is performed. if the refresh request is not processed before the next match, the previous request becomes ineffective. when the cmie bit in rtscr is set to 1, an interrupt request is sent to the controller by this match signal. the interrupt request is output continuously until the cmf bit in rtscr is cleared. when the cmf bit clears, it only affects the interrupt; the refresh request is not cleared by this operation. when a refresh is performed and refresh requests are counted using interrupts, a refresh can be set simultaneously with the interval timer interrupt. ? bits 15 to 8?eserved: these bits always read 0. the write value should always be 0. 7.3 access size and data alignment 7.3.1 connection to ordinary devices byte, word, and longword are supported as access units . data is aligned based on the data width of the device . therefore, reading longword data from a byte-width device requires four read operations . the bus state controller automatically converts data alignment and data length between interfaces. the data width for external devices can be connected to either 8 bits, 16 bits or 32 bits by setting bcr2 (for the cs1?s3 spaces) or using the mode pins (for the cs0 space). since the data width of devices connected to the respective spaces is specified statically, however, the data width cannot be changed for each access cycle. .com .com .com .com 4 .com u datasheet
149 instruction fetches are always performed in 32-bit units. when branching to an odd word boundary (4n + 2 address), instruction fetches are performed in longword units from a 4n address. figures 7.2 to 7.4 show the relationship between device data widths and access units. d31 70 d23 d15 d7 d0 15 8 70 70 70 70 a26 a0 000000 000001 000002 000003 000000 000002 000000 32-bit device data input/output pin byte read/write of address 0 byte read/write of address 1 byte read/write of address 2 byte read/write of address 3 word read/write of address 0 word read/write of address 2 longword read/write of address 0 31 24 23 16 15 8 70 15 8 7 0 figure 7.2 32-bit external devices and their access units (ordinary) d15 70 d7 d0 15 0 70 70 70 a26 a0 000000 000001 000002 000003 000000 000002 000000 000002 16-bit device data input/output pin byte read/write of address 0 byte read/write of address 1 byte read/write of address 2 byte read/write of address 3 word read/write of address 0 word read/write of address 2 longword read/write of address 0 15 0 31 16 15 0 figure 7.3 16-bit external devices and their access units (ordinary) d7 70 d0 70 70 70 15 8 70 15 8 70 31 24 23 26 15 8 70 a26 a0 000000 000001 000002 000003 000000 000001 000002 000003 000000 000001 000002 000003 8-bit device data input/output pin byte read/write of address 0 byte read/write of address 1 byte read/write of address 2 byte read/write of address 3 word read/write of address 0 word read/write of address 2 longword read/write of address 0 figure 7.4 8-bit external devices and their access units (ordinary) .com .com .com .com 4 .com u datasheet
150 7.3.2 connection to little-endian devices the sh7604 provides a conversion function in cs2 space for connection to and to maintain program compatibility with devices that use little-endian format (in which the lsb is the 0 position in the byte data lineup). when the endian specification bit of bcr1 is set to 1, cs2 space is little-endian. the relationship between device data width and access unit for little-endian format is shown in figures 7.5 and 7.6. when sharing memory or the like with a little-endian bus master, the sh7604 connects d31?24 to the least significant byte of the other bus master and d7?0 to the most significant byte, when the bus width is 32 bits. when the width is 16 bits, the sh7604 connects d15?8 to the least significant byte of the other bus master and d7?0 to the most significant byte. when support software like the compiler or linker does not support switching, the instruction code and constants in the program do not become little-endian. for this reason, be careful not to place program code or constants in the cs2 space. when instructions or data in other cs spaces are used by transferring them to cs2 space with the sh7604, there is no problem because the sh7604 converts the endian format. programs that are designed for use with little-endian format assume that the lsb is stored in the lowest address. even when a program written in a high-level language like c is recompiled as is, it may not execute properly. the sign bit of signed 16-bit data at address 0 is stored at address 1 in little-endian format and at address 0 in big-endian format. it is possible to correctly execute a program written for little-endian format by allocating the program and constants to an area other than cs2 space and the data area to cs2 space. note that the sh7604 does not support little-endian mode for devices with an 8-bit data bus width. d31 70 70 70 d23 d15 d7 d0 15 8 70 70 70 a26 a0 000000 000001 000002 000003 000000 000002 000000 32-bit device data input/output pin byte read/write of address 0 byte read/write of address 1 byte read/write of address 2 byte read/write of address 3 word read/write of address 0 word read/write of address 2 longword read/write of address 0 15 8 70 15 8 23 16 31 24 figure 7.5 32-bit external devices and their access units (little-endian format) .com .com .com .com 4 .com u datasheet
151 d15 70 d7 d0 7 8 70 70 0 7 15 015 015 16 31 0 a26 a0 000000 000001 000002 000003 000000 000002 000000 000002 16-bit device data input/output pin byte read/write of address 0 byte read/write of address 1 byte read/write of address 2 byte read/write of address 3 word read/write of address 0 word read/write of address 2 longword read/write of address 0 7 8 7 8 23 24 figure 7.6 16-bit external devices and their access units (little-endian format) using the little-endian function: the sh7604 normally uses big-endian alignment for data input and output, but an endian conversion function is provided for the cs2 space to enable connection to little-endian devices. the following two points should be noted when using this function: ? little endian alignment should be used in the cs2 through-area. ? when data is shared with another little-endian device using this function, the same access size must be used by both. for example, to read data written in longword size by another little- endian device, the sh7604 must use longword read access. 7.4 accessing ordinary space 7.4.1 basic timing a strobe signal is output by ordinary space accesses of cs0?s3 spaces to provide primarily for sram direct connections. figure 7.7 shows the basic timing of ordinary space accesses. ordinary accesses without waits end in 2 cycles. the bs signal is asserted for 1 cycle to indicate the start of the bus cycle. the csn signal is negated by the fall of clock t2 to ensure the negate period. the negate period is thus half a cycle when accessed at the minimum pitch. the access size is not specified during a read. the correct access start address will be output to the lsb of the address, but since no access size is specified, the read will always be 32 bits for 32-bit devices and 16 bits for 16-bit devices. for writes, only the we signal of the byte that will be written is asserted. for 32-bit devices, we3 specifies writing to a 4n address and we0 specifies writing to a 4n+3 address. for 16-bit devices, we1 specifies writing to a 2n address and we0 specifies writing to a 2n+1 address. for 8-bit devices, only we0 is used. the rd signal must be used to control data output of external devices so that conflicts do not occur between trace information for emulators or the like output from the sh7604 and external device read data. in other words, when data buses are provided with buffers, the rd signal must be used for data output in the read direction. when rd/ wr signals do not perform accesses, the .com .com .com .com 4 .com u datasheet
152 chip stays in read status, so there is a danger of conflicts occurring with output when this is used to control the external data buffer. t1 t2 ckio read write a26 a0 csn wr rd d0 wen d0 bs figure 7.7 basic timing of ordinary space access figure 7.8 shows an example of a 32-bit data width sram connection, figure 7.9 a 16-bit data width sram connection, and figure 7.10 an 8-bit data width sram connection. .com .com .com .com 4 .com u datasheet
153 a18 a2 csn rd cashh we3 cashl we2 caslh we1 casll we0 cs oe we a16 a0 cs oe we a16 a0 cs oe we a16 a0 cs oe we figure 7.8 example of 32-bit data width sram connection .com .com .com .com 4 .com u datasheet
154 a17 a1 csn rd caslh we1 casll we0 cs oe we a16 a0 cs oe we figure 7.9 example of 16-bit data width sram connection a16 a0 csn rd casll we0 cs oe we figure 7.10 example of 8-bit data width sram connection .com .com .com .com 4 .com u datasheet
155 7.4.2 wait state control the number of wait states inserted into ordinary space access states can be controlled using the wcr and bcr1 register settings. when the wn1 and wn0 wait specification bits in wcr for the given cs space are 01 or 10, software waits are inserted according to the wait specification. when wn1 and wn0 are 11, wait cycles are inserted according to the long wait specification bit anlw in bcr1. the long wait specification in bcr1 can be made independently for cs0 and cs1 spaces, but the same value must be specified for cs2 and cs3 spaces. all wcr specifications are independent. a tw cycle as long as the number of specified cycles is inserted as a wait cycle at the wait timing for ordinary access space shown in figure 7.11. t1 tw ckio read write a26 a0 csn wr rd d0 wen d0 bs figure 7.11 wait timing of ordinary space access (software wait only) .com .com .com .com 4 .com u datasheet
156 when the wait is specified by software using wcr, the wait input wait signal from outside is sampled. figure 7.12 shows wait signal sampling. a 2-cycle wait is specified as a software wait. the sampling is performed when the tw state shifts to the t2 state, so there is no effect even when the wait signal is asserted in the t1 cycle or the first tw cycle. the wait signal is sampled at the clock rise. external waits should not be inserted, however, into word accesses of devices (such as ordinary space and burst rom) that have an 8-bit bus width (byte-size devices). control waits in such cases with software only. t1 tw clock read write a26 a0 csn wait wr rd d0 wen d0 bs wait figure 7.12 wait state timing of ordinary space access (wait states from wait signal) .com .com .com .com 4 .com u datasheet
157 7.5 synchronous dram interface 7.5.1 synchronous dram direct connection 2-mbit (128k 16), 4-mbit (256k 16), and 16-mbit (1m 16, 2m 8, and 4m 4) synchronous drams can be connected directly to the sh7604 . all of these are internally divided into two banks. since synchronous dram can be selected by the cs signal, areas cs2 and cs3 can be connected using a common ras or other control signal. when the enable bits for dram and other memory (dram2?ram0) in bcr1 are set to 001, cs2 is ordinary space and cs3 is synchronous dram space. when set to 100, cs2 is synchronous dram space and cs3 is ordinary space. when set to 101, both cs2 and cs3 are synchronous dram spaces. the supported synchronous dram operating mode is for burst read and single write. the burst length depends on the data bus width, comprising 4 bursts for a 32-bit width, and 8 bursts for a 16- bit width. the data bus width is specified by the sz bit in mcr. burst operation is always performed, so the burst enable (be) bit in mcr is ignored. control signals for directly connecting synchronous dram are the ras / ce , cas / oe , rd/ wr , cs2 or cs3 , dqmuu, dqmul, dqmlu, dqmll, and cke signals . signals other than cs2 and cs3 are common to every area, and signals other than cke are valid and fetched only when cs2 or cs3 is true . therefore, synchronous dram of multiple areas can be connected in parallel. cke is negated (to the low level); only when a self-refresh is performed otherwise it is asserted (to the high level). commands can be specified for synchronous dram using the ras / ce , cas / oe , rd/ wr , and certain address signals. these commands are nop, auto-refresh (ref), self-refresh (self), all- bank precharge (pall), specific bank precharge (pre), row address strobe/bank active (actv), read (read), read with precharge (reada), write (writ), write with precharge (writa), and mode register write (mrs). bytes are specified using dqmuu, dqmul, dqmlu, and dqmll. the read/write is performed on the byte whose dqm is low. for 32-bit data, dqmuu specifies 4n address access and dqmll specifies 4n + 3 address access. for 16-bit data, only dqmlu and dqmll are used. figure 7.13 shows an example in which a 32-bit connection uses a 256k 16 bit synchronous dram. figure 7.14 shows an example with a 16-bit connection. .com .com .com .com 4 .com u datasheet
158 a11 a2 ckio cke csn ras ce cas oe wr cashh we3 cashl we2 caslh we1 casll we0 cs ras cas we a9 a0 clk cke cs ras cas we figure 7.13 synchronous dram 32-bit device connection .com .com .com .com 4 .com u datasheet
159 a10 a1 ckio cke csn ras ce cas oe wr caslh we1 casll we0 cs ras cas we figure 7.14 synchronous dram 16-bit device connection 7.5.2 address multiplexing addresses are multiplexed according to the mcr? address multiplex specification bits amx2 amx0 and size specification bit sz so that synchronous drams can be connected directly without an external multiplex circuit . table 7.4 shows the relationship between the multiplex specification bits and bit output to the address pins. a26?14 and a0 always output the original value regardless of multiplexing. when sz = 0, the data width on the synchronous dram side is 16 bits and the lsb of the device? address pins (a0) specifies word address. the a0 pin of the synchronous dram is thus connected to the a1 pin of the sh7604, the rest of the connection proceeding in the same order, beginning with the a1 pin to the a2 pin. when sz = 1, the data width on the synchronous dram side is 32 bits and the lsb of the device? address pins (a0) specifies longword address. the a0 pin of the synchronous dram is thus connected to the a2 pin of the sh7604, the rest of the connection proceeding in the same order, beginning with the a1 pin to the a3 pin. .com .com .com .com 4 .com u datasheet
160 table 7.4 sz and amx bits and address multiplex output setting external address pins sz amx2 amx1 amx0 output timing a1?8 a9 a10 a11 a12 a13 1 0 0 0 column address a1 a8 a9 a10 a11 l/h *1 a21 *2 row address a9 a16 a17 a18 a19 a20 a21 *2 1 0 0 1 column address a1 a8 a9 a10 a11 l/h *1 a22 *2 row address a10 a17 a18 a19 a20 a21 a22 *2 1 0 1 0 column address a1 a8 a9 a10 a11 l/h *1 a23 *2 row address a11 a18 a19 a20 a21 a22 a23 *2 1 0 1 1 column address a1 a8 a9 l/h *1 a19 *2 a12 a13 row address a9 a16 a17 a18 a19 *2 a20 a21 1 1 1 1 column address a1 a8 a9 l/h *1 a18 *2 a12 a13 row address a9 a16 a17 a17 a18 *2 a20 a21 0 0 0 0 column address a1 a8 a9 a10 l/h *1 a20 *2 a13 row address a9 a16 a17 a18 a19 a20 *2 a21 0 0 1 1 column address a1 a8 l/h *1 a18 *2 a11 a12 a13 row address a9 a16 a17 a18 *2 a19 a20 a21 0 1 1 1 column address a1 a8 l/h *1 a17 *2 a11 a12 a13 row address a9 a16 a16 a17 *2 a19 a20 a21 amx2 amx0 settings of 100, 101 and 110 are reserved, so do not use them. when sz = 0, the settings 001 and 010 are reserved as well, so do not use them either. notes: 1. l/h is a bit used to specify commands. it is fixed at l or h according to the access mode. 2. specifies bank address. 7.5.3 burst reads figure 7.15 shows the timing chart for burst reads. in the following example, 2 synchronous drams of 256k 16 bits are connected, the data width is 32 bits and the burst length is 4. after a tr cycle that performs actv command output, a reada command is called in the tc cycle and read data is accepted at internal clock falls from td1 to td4. tap is a cycle for waiting for the completion of the auto-precharge based on the reada command within the synchronous dram. during this period, no new access commands are issued to the same bank. accesses of the other bank of the synchronous dram by another cs space are possible. depending on the trp specification in mcr, the sh7604 determines the number of tap cycles and does not issue a command to the same bank during that period. .com .com .com .com 4 .com u datasheet
161 figure 7.15 shows an example of the basic cycle. because a slower synchronous dram is connected, setting wcr and mcr bits can extend the cycle. the number of cycles from the actv command output cycle tr to the reada command output cycle tc can be specified by the rcd bit in mcr. 0 specifies 1 cycle; 1 specifies 2 cycles. for 2 cycles, a nop command issue cycle trw for the synchronous dram is inserted between the tr cycle and the tc cycle. the number of cycles between the reada command output cycle tc and the initial read data fetch cycle td1 can be specified independently for areas cs2 and cs3 between 1 cycle and 4 cycles using the w21/w20 and w31/w30 bits in wcr. the cas latency when using bus arbitration in the partial-share master mode can be set differently for cs2 and cs3 spaces. the number of cycles at this time corresponds to the number of cas latency cycles of the synchronous dram. when 2 cycles or more, a nop command issue cycle tw is inserted between the tc cycle and the td1 cycle. the number of cycles in the precharge completion waiting cycle tap is specified by the trp bit in mcr. when the cas latency is 1, a tap cycle of 1 or 2 cycles is generated. when the cas latency is 2 or more, a tap cycle equal to the trp specification ?1 is generated. during the tap cycle, no commands other than nop are issued to the same bank. figure 7.16 shows an example of burst read timing when rcd is 1, w31/w30 is 01, and trp is 1. with the synchronous dram cycle, when the bus cycle starts in ordinary space access, the bs signal asserted for 1 cycle is asserted in each of cycles td1?d4 for the purpose of the external address monitoring described in the section on bus arbitration. when another cs space is accessed after an synchronous dram read with a wait-between-buses specification of 0, the bs signal may be continuously asserted. the address is updated every time data is fetched while burst reads are being performed. the burst transfer unit is 16 bytes, so address updating affects a3?1. the access order follows the address order in 16-byte data transfers by the dmac, but reading starts from the address + 4 so that the last missed data in the fill operation after a cache miss can be read. when the data width is 16 bits, 8 burst cycles are required for a 16-byte data transfer. the data fetch cycle goes from td1 to td8. from td1 to td8, the bs signal is asserted in every cycle. synchronous dram cas latency is up to 3 cycles, but the cas latency of the bus state controller can be specified up to 4. this is so that circuits containing latches can be installed between synchronous drams and the sh7604. .com .com .com .com 4 .com u datasheet
162 tr ckio a26 a11 a10 a9 a1 cs2 cs3 ras cas we d0 bs figure 7.15 basic burst read timing (auto-precharge) .com .com .com .com 4 .com u datasheet
163 tr trw tc ckio a26 a11 a10 a9 a1 cs2 cs3 ras cas we d0 bs figure 7.16 burst read wait specification timing (auto-precharge) .com .com .com .com 4 .com u datasheet
164 7.5.4 single reads when a cache area is accessed and there is a cache miss, the cache fill cycle is performed in 16- byte units. this means that all the data read in the burst read is valid. since the required data when a cache-through area is accessed has a maximum length of 32 bits, however, the remaining 12 bytes are wasted. the same kind of wasted data access is produced when synchronous dram is specified as the source in a dma transfer by the dmac and the transfer unit is other than 16 bytes. figure 7.17 shows the timing of a single address read. because the synchronous dram is set to the burst read/single write mode, the read data output continues after the required data is received. to avoid data conflict, an empty read cycle is performed from td2 to td4 after the required data is read in td1 and the device waits for the end of synchronous dram operation. in this case, data is only fetched in td1, so the bs signal is asserted for td1 only. when the data width is 16 bits, the number of burst transfers during a read is 8. bs is asserted and data fetched in cache-through and other dma read cycles only in the td1 and td2 cycles (of the 8 cycles from td1 to td8) for longword accesses, and only in the td1 cycle for word or byte accesses. empty cycles tend to increase the memory access time, lower the program execution speed, and lower the dma transfer speed, so it is important to avoid accessing unnecessary cache-through areas and to use data structures that enable 16-byte unit transfers by placing data on 16-byte boundaries when performing dma transfers that specify synchronous dram as the source. .com .com .com .com 4 .com u datasheet
165 tr ckio a26 a11 a10 a9 a1 cs2 cs3 ras cas we d0 bs figure 7.17 single read timing (auto-precharge) 7.5.5 writes unlike synchronous dram reads, synchronous dram writes are single writes. figure 7.18 shows the basic timing chart for write accesses. after the actv command tr, a writa command is issued in tc to perform an auto-precharge. in the write cycle, the write data is output simultaneously with the write command. when writing with an auto-precharge, the bank is precharged after the completion of the write command within the synchronous dram, so no command can be issued to that bank until the precharge is completed. for that reason, besides a cycle tap to wait for the precharge during read accesses, the issuing of any new commands to the same bank during this period is delayed by adding a cycle trw1 to wait until the precharge is started. the number of cycles in the trw1 cycle can be specified using the trwl bit in mcr. .com .com .com .com 4 .com u datasheet
166 tr ckio a26 a11 a10 a9 a1 cs2 cs3 ras cas we d0 bs figure 7.18 basic write cycle timing (auto-precharge) 7.5.6 bank active function a synchronous dram bank function is used to support high-speed accesses of the same row address. when the rasd bit in mcr is set to 1, read/write accesses are performed using commands without auto-precharge (read, writ). in this case, even when the access is completed, no precharge is performed. when accessing the same row address in the same bank, a read or writ command can be called immediately without calling an actv command, just like the ras down mode of the dram? high-speed page mode . synchronous dram is divided into two banks, so one row address in each can stay active. when the next access is to a different row address, a pre command is called first to precharge the bank, and access is performed by an .com .com .com .com 4 .com u datasheet
167 actv command and read or writ command, in that order, after the precharge is completed. with successive accesses to different row addresses, the precharge is performed after the access request occurs, so the access time is longer. when writing, performing an auto-precharge means that no command can be called for t rwl + t ap cycles after a writa command is called. when the bank active mode is used, read or writ commands can be issued consecutively if the row address is the same. this shortens the number of cycles by t rwl + t ap for each write. the number of cycles between the issue of the precharge command and the row address strobe command is determined by the trp bit in mcr. whether execution is faster when the bank active mode is used or when basic access is used is determined by the proportion of accesses to the same row address (p1) and the average number of cycles from the end of one access to the next access (t a ). when ta is longer than t ap , the delay waiting for the precharge during a read becomes invisible. if t a is longer than t rwl + t ap , the delay waiting for the precharge also becomes invisible during writes. the difference between the bank active mode and basic access speeds in these cases is the number of cycles between the start of access and the issue of the read/write command: (t rp + t rcd ) (1 ?p1) and t rcd , respectively. the time that a bank can be kept active, t ras , is limited. when it is not assured that this period will be provided by program execution and that another row address will be accessed without a hit to the cache, the synchronous dram must be set to auto-refresh and the refresh cycle must be set to the maximum value t ras or less. this enables the limit on the maximum active period for each bank to be ensured. when auto-refresh is not being used, some measure must be taken in the program to ensure that the bank does not stay active for longer than the prescribed period. figure 7.19 shows a burst read cycle that is not an auto-precharge cycle, figure 7.20 shows a burst read cycle to a same row address, figure 7.21 shows a burst read cycle to different row addresses, figure 7.22 shows a write cycle without auto-precharge, figure 7.23 shows a write cycle to a same row address, and figure 7.24 shows a write cycle to different row addresses. in figure 7.20, a cycle that does nothing, tnop, is inserted before the tc cycle that issues the read command. synchronous drams, however, have a 2 cycle latency during reads for the dqmxx signals that specify bytes. if the tc cycle is performed immediately without inserting a tnop cycle, the dqmxx signal for the td1 cycle data output cannot be specified. this is why the tnop cycle is inserted. when the cas latency is 2 or more, the tnop cycle is not inserted so that timing requirements will be met even when a dqmxx signal is set after the tc cycle. when the sh7604 is set to the bank active mode, the access will start with figure 7.19 or figure 7.22 and repeat figure 7.20 or figure 7.23 for as long as the same row address continues to be accessed when only accesses to the respective banks of the cs3 space are considered. accesses to other cs spaces during this period have no effect. when an access occurs to a different row address while the bank is active, figure 7.21 or figure 7.24 will be substituted for figures 7.20 and 7.23 after this is detected. both banks will become inactive even in the bank active mode after the refresh cycle ends or after the bus is released by bus arbitration. .com .com .com .com 4 .com u datasheet
168 tr ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.19 burst read timing (no precharge) .com .com .com .com 4 .com u datasheet
169 tnop ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.20 burst read timing (bank active, same row address) .com .com .com .com 4 .com u datasheet
170 tp ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.21 burst read timing (bank active, different row addresses) .com .com .com .com 4 .com u datasheet
171 tr ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.22 write timing (no precharge) .com .com .com .com 4 .com u datasheet
172 tc ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.23 write timing (bank active, same row address) .com .com .com .com 4 .com u datasheet
173 tp ckio a26 a11 a10 a9 a1 cs3 ras cas we d0 bs figure 7.24 write timing (bank active, different row addresses) .com .com .com .com 4 .com u datasheet
174 7.5.7 refreshes the bus state controller is equipped with a function to control refreshes of synchronous dram. auto-refreshes can be performed by setting the mcr? rmd bit to 0 and the rfsh bit to 1. when the synchronous dram is not accessed for a long period of time, set the rfsh bit and rmode bit both to 1 to initiate self-refresh mode, which uses low power consumption to retain data. auto-refresh: refreshes are performed at the interval determined by the input clock selected by the cks2?ks0 bits in rtcsr and the value set in rtcor. set the cks2?ks0 bits and rtcor so that the refresh interval specifications of the synchronous dram being used are satisfied. first, set rtcor, rtcnt and the rmode and rfsh bits in mcr, then set the cks2 cks0 bits. when a clock is selected with the cks2?ks0 bits, rtcnt starts counting up from the value at that time. the rtcnt value is constantly compared to the rtcor value and a request for a refresh is made when the two match, starting an auto-refresh. rtcnt is cleared to 0 at that time and the count up starts again. figure 7.25 shows the timing for the auto-refresh cycle. first, a pall command is issued during the tp cycle to change all the banks from active to precharge states. a ref command is then issued in the trr cycle. after the trr cycle, no new commands are output for the number of cycles specified in the tras bit in mcr + 2 cycles. the tras bit must be set to satisfy the refresh cycle time specifications (active/active command delay time) of the synchronous dram. when the mcr? trp bit is 1, an nop cycle is inserted between the tp cycle and trr cycle. during a manual reset, no refresh request is issued, since there is no rtcnt count-up. to perform a refresh properly, make the manual reset period shorter than the refresh cycle interval and set rtcnt to (rtcor ?1) so that the refresh is performed immediately after the manual reset is cleared. .com .com .com .com 4 .com u datasheet
175 tp ckio a10 cs2 cs3 ras cas we bs figure 7.25 auto-refresh timing self-refreshes: the self-refresh mode is a type of standby mode that produces refresh timing and refresh addresses within the synchronous dram. it is started up by setting the rmode and rfsh bits to 1. the synchronous dram is in self-refresh mode when the cke signal level is low. during the self-refresh, the synchronous dram cannot be accessed. to clear the self-refresh, set the rmode bit to 0. after self-refresh mode is cleared, issuing of commands is prohibited for the number of cycles specified in the mcr? tras bit + 1 cycle. figure 7.26 shows the self- refresh timing. immediately set the synchronous dram so that the auto-refresh is performed in the correct interval. this ensures a correct self-refresh clear and data holding. when self-refresh mode is entered while the synchronous dram is set for auto-refresh or when leaving the standby mode with a manual reset or nmi, auto-refresh can be re-started if rfsh is 1 and rmode is 0 when the self-refresh mode is cleared. when time is required between clearing the self-refresh mode and starting the auto-refresh mode, this time must be reflected in the initial rtcnt setting. when the rtcnt value is set to rtcor ?1, the refresh can be started immediately. if the standby function of the sh7604 is used after the self-refresh is set to enter the standby mode, the self-refresh state continues; the self-refresh state will also be maintained after returning from a standby using an nmi. a manual reset cannot be used to exit the self-refresh state either. during a power-on reset, the bus state controller register is initialized, so the self-refresh state is ended. .com .com .com .com 4 .com u datasheet
176 refresh requests and bus cycle requests: when a refresh request occurs while a bus cycle is executing, the refresh will not be executed until the bus cycle is completed. when a refresh request occurs while the bus is released using the bus arbitration function, the refresh will not be executed until the bus is recaptured. if rtcnt and rtcor match and a new refresh request occurs while waiting for the refresh to execute, the previous refresh request is erased. to make sure the refresh executes properly, be sure that the bus cycle and bus capture do not exceed the refresh interval. if a bus arbitration request occurs during a self-refresh, the bus is not released until the self-refresh is cleared. during a self-refresh, the slave chips halt if there is a master-slave structure. tp ckio a10 cke cs2 cs3 ras cas we bs figure 7.26 self-refresh timing .com .com .com .com 4 .com u datasheet
177 7.5.8 power-on sequence to use synchronous dram, the mode must first be set after the power is turned on. to properly initialize the synchronous dram, the synchronous dram mode register must be written to after the registers of the bus state controller have first been set. the synchronous dram mode register is set using a combination of the ras / ce , cas / oe and rd/ wr signals. they fetch the value of the address signal at that time. if the value to be set is x, the bus state controller operates by writing to address x + h'ffff8000 from the cpu, which allows the value x to be written to the synchronous dram mode register. data is ignored at this time, but the mode is written using word as the size. write any data in word size to the following addresses to select the burst read single write supported by the sh7604, a cas latency of 1 to 3, a sequential wrap type, and a burst length of 8 or 4 (depending on whether the width is 16 bits or 32 bits). for 16 bits: cas latency 1 cas latency 2 cas latency 3 h'ffff8426 h'ffff8446 h'ffff8466 for 32 bits: cas latency 1 cas latency 2 cas latency 3 h'ffff8848 h'ffff8888 h'ffff88c8 figure 7.27 shows the mode register setting timing. writing to address x + h'ffff8000 first issues an all-bank precharge command (pall) in the tp cycle, then issues a mode register write command in the tmw cycle. when the trp bit in mcr is set to 1, a single idle cycle is inserted between the tp cycle and the tmw cycle. before setting the mode register, an idle time of 100 s (differs by memory manufacturer) must be assured after the power required by the synchronous dram is turned on. when the pulse width of the reset signal is longer than the idle time, the mode register may be set immediately without problem. at least the number of dummy auto-refresh cycles specified by the manufacturer (usually 8 must be executed). after setting auto-refresh, it is usual for this to occur naturally during the various initializations, but to make sure, the interval at which refresh requests are generated can be shortened only while the dummy cycles are executing. because the address counter within the synchronous dram is not initialized when auto-refresh is used during single read or write accesses, an auto-refresh cycle must always be used. .com .com .com .com 4 .com u datasheet
178 tp ckio a26 a12 a10 a11 a9 a1 cs2 cs3 ras cas we bs figure 7.27 synchronous dram mode write timing .com .com .com .com 4 .com u datasheet
179 7.5.9 phase shift by pll the signals for synchronous dram interfaces change in the sh7604 at the rising edge of the internal clock. read data is fetched on the falling edge of an internal clock. sampling of the signals input by the synchronous dram and output of the read data, however, starts at the rising edge of the external clock (figure 7.28). when the internal clock of the sh7604 and external clock are synchronized, signal transmission from the sh7604 to the synchronous dram has a 1 cycle margin. the transmission of read data from the synchronous dram to the sh7604, however, is much tighter: only 1/2 cycle, including the synchronous dram access time. when a clock system is connected without a means of synchronization such as an on-chip pll, transmission from the sh7604 to the synchronous dram takes 1 cycle less the delay time of the clock system and transmission from the synchronous dram to the sh7604 takes 1/2 cycle plus the clock system delay time. the clock system delay time depends on the power supply voltage, temperature, and manufacturing variance, so it has a fairly wide range. when the phase of the internal clock of the sh7604 is delayed using a pll that delays the phase 90 degrees relative to external clocks, transmission from the sh7604 to the synchronous dram and transmission from the sh7604 to the synchronous dram each take 3/4 cycle. given this, using a clock whose phase is shifted 90 degrees from the external clock using a pll as the internal clock can ensure a margin of safety. when using a pll, it is important to note that synchronous dram does not contain an on-chip pll. when using the external clock input clock mode, instability in the clock supplied from outside can cause shifts in phase, so a synchronization settling time in the sh7604? on-chip pll is needed to equalize the sh7604? internal clock and the external clock. during this synchronization settling time, the internal clock of the synchronous dram and the internal clock of the sh7604 will not always operate in perfect synchronization. to ensure the synchronous dram and sh7604 operate properly, be sure that the external clock supplied is not unstable. .com .com .com .com 4 .com u datasheet
180 a. phase shifted 90 figure 7.28 phase shift by pll .com .com .com .com 4 .com u datasheet
181 c. no pll used external clk (ckio) internal clk 1 figure 7.28 phase shift by pll (cont) 7.6 dram interface 7.6.1 dram direct connection when the dram and other memory enable bits (dram2?ram0) in bcr1 are set to 010, the cs3 space becomes dram space, and a dram interface function can be used to directly connect the sh7604 to dram. the data width of an interface can be 16 or 32 bits (figures 7.29 and 7.30) . two-cas 16-bit drams can be connected, since cas is used to control byte access . the ras, cashh , cashl , caslh , casll , and rd/ wr signals are used to connect the dram. when the data width is 16 bits, cashh , and cashl are not used. in addition to ordinary read and write access, burst access using high-speed page mode is also supported . .com .com .com .com 4 .com u datasheet
182 a10 a2 d15 d0 ras ce wr cashh we3 cashl we2 ras oe we ucas lcas caslh we1 casll we0 ras oe we ucas lcas figure 7.29 example of dram connection (32-bit data width) .com .com .com .com 4 .com u datasheet
183 a9 a1 ras ce wr caslh we1 casll we0 ras oe we ucas lcas figure 7.30 example of dram connection (16-bit data width) 7.6.2 address multiplexing when the cs3 space is set to dram, addresses are always multiplexed. this allows drams that require multiplexing of row and column addresses to be connected directly to sh7604 microprocessors without additional multiplexing circuits. there are four ways of multiplexing, which can be selected using the mcr? amx1?mx0 bits. table 7.5 illustrates the relationship between the amx1?mx0 bits and address multiplexing. address multiplexing is performed on address output pins a13?1. the original addresses are output to pins a26?14. during dram accesses, amx2 is reserved, so set it to 0. table 7.5 relationship between amx1?mx0 and address multiplexing amx1 amx0 no. of column address bits row address output column address output 0 0 8 bits a21 a9 a13 a1 1 9 bits a22 a10 a13 a1 1 0 10 bits a23 a11 a13 a1 1 11 bits a24 a12 a13 a1 .com .com .com .com 4 .com u datasheet
184 7.6.3 basic timing the basic timing of a dram access is 3 cycles. figure 7.31 shows the basic dram access timing. tp is the precharge cycle, tr is the ras assert cycle, tc1 is the cas assert cycle, and tc2 is the read data fetch cycle. when accesses are consecutive, the tp cycle of the next access overlaps the tc2 cycle of the previous access, so accesses can be performed in a minimum of 3 cycles each. tp tr tc1 tc2 ckio read write a26 a14 a13 a1 ras casn wr rd d0 rd/ wr rd d0 cs3 bs figure 7.31 basic access timing .com .com .com .com 4 .com u datasheet
185 7.6.4 wait state control when the clock frequency is raised, 1 cycle may not always be sufficient for all states to end, as in basic access. setting bits in wcr and mcr enables the state to be lengthened. figure 7.32 shows an example of lengthening a state using settings. the tp cycle (which ensures a sufficient ras precharge time) can be extended to 2 cycles by insertion of a tpw cycle by means of the trp bit in mcr. the number of cycles between ras assert and cas assert can be extended to 2 cycles by inserting a trw cycle by means of the rcd bit in mcr. the number of cycles from cas assert to the end of access can be extended from 1 cycle to 3 cycles by setting the w31/w30 bits in wcr. when a value other than 00 is set in w31 and w30, the external wait pin wait is also sampled, so the number of cycles is further increased. figure 7.33 shows the timing of wait state control using the wait pin. in either case, when consecutive accesses occur, the tp cycle of one access overlaps the tc2 cycle of the previous access. tp tpw tr trw tc1 tw tc2 ckio read write a26 a14 a13 a1 ras casn wr rd d0 rd/ wr rd d0 cs3 bs figure 7.32 wait state timing .com .com .com .com 4 .com u datasheet
186 tp tr tc1 tw twx tc2 ckio read write a26 a14 a13 a1 ras casn wr rd d0 rd/ wr rd d0 cs3 bs wait figure 7.33 external wait state timing 7.6.5 burst access in addition to the ordinary mode of dram access, in which row addresses are output at every access and data is then accessed, dram also has a high-speed page mode for use when continuously accessing the same row that enables fast access of data by changing only the column address after the row address is output. select ordinary access or high-speed page mode by setting the burst enable bit (be) in mcr. figure 7.34 shows the timing of burst operation in high-speed page mode. when performing burst access, cycles can be inserted using the wait state control function. .com .com .com .com 4 .com u datasheet
187 the sh7604 has an address comparator to detect matches of row addresses in burst mode. when this function is used and the be bit in mcr is set to 1, setting the mcr? rasd bit (which specifies ras down mode) to 1 places the sh7604 in ras down mode, which leaves the ras signal asserted. since the cashh , cashl , caslh and casll signals are shared with we3 , we2 , we1 and we0 of ordinary space, however, write cycles to ordinary space during ras down mode will simultaneously initiate an erroneous write access to the dram. this means that when no external devices that write to other than dram are connected, a dram can be directly interfaced using ras down mode. when ras down mode is used, the refresh cycle must be less than the maximum dram ras assert time t ras when the refresh cycle is longer than the t ras maximum. when an external circuit is added to keep the cashh , cashl , caslh, and casll signals connected to the dram asserted only when the cs3 level is low, there are no restrictions on the use of ras down mode. tp tr tc2 tc1 tc2 tc1 ckio read write a26 a14 a13 a0 ras casn wr rd d0 rd/ wr rd d0 cs3 bs figure 7.34 burst access timing .com .com .com .com 4 .com u datasheet
188 7.6.6 refresh timing the bsc has a function for controlling dram refreshes. by setting the mcr? rmode bit to 0 and rfsh bit to 1, distributed refreshing using the cas-before-ras refresh cycle can be performed. refreshes are performed at the interval determined by the input clock selected with cks2?ks0 in rtcsr and the value set in rtcor. set the values of rtcor and cks2?ks0 so they satisfy the refresh interval specifications of the dram being used. first, set rtcor, rtcnt and the rmode and rfsh bits in mcr, then set the cks2?ks0 bits. when a clock is selected with the cks2?ks0 bits, rtcnt starts counting up from the value at that time. the rtcnt value is constantly compared to the rtcor value and a request for a refresh is made when the two match, starting a cas-before-ras refresh. rtcnt is cleared to 0 at that time and the count up starts again. figure 7.35 shows the timing for the cas-before-ras refresh cycle. the number of ras assert cycles in the refresh cycle is specified by the tras bit in mcr. as with ordinary accesses, the specification of the ras precharge time in refresh cycles follows the setting of the trp bit in mcr. tp trr trc1 trc2 tre ckio ras casn wr rd cs3 bs figure 7.35 refresh cycle timing .com .com .com .com 4 .com u datasheet
189 7.6.7 power-on sequence when dram is used after the power is turned on, there is a requirement for a waiting period during which accesses cannot be performed (100 s or 200 s minimum) followed by the prescribed number of dummy cas-before-ras refresh cycles (usually 8). the bus state controller does not perform any special operations for the power-on reset, so the required power-on sequence must be implemented by the initialization program executed after a power-on reset. 7.7 pseudo-sram interface 7.7.1 pseudo-sram direct connection when the dram and other memory enable bits (dram2?ram0) in bcr1 are set to 011, the cs3 space becomes pseudo-sram space, and the pseudo-sram interface function can be used to directly connect the sh7604 to pseudo-sram. the interface data width is 16 or 32 bits. the refresh and output enable signals of the connected pseudo-sram are multiplexed. the signals used for connecting pseudo-sram are the ce , oe , we3 , we2 , we1, and we0 signals . the we3 and we2 signals are not used when the data width is 16 bits. when non-multiplexed pseudo-sram is connected, the rd signal is also used. in addition to ordinary read and write access, burst access using the static column access function is also supported . figure 7.36 shows an example of connections to 1-m pseudo-sram with separate oe and rfsh pins; figure 7.37 shows an example of connections to 4-m pseudo-sram with multiplexed oe / rfsh pins. 256-k pseudo-sram is multiplexed in the same way as 4-m pseudo-sram. all data widths are 32 bits. .com .com .com .com 4 .com u datasheet
190 a16 a0 ce oe rfsh we a16 a0 cs oe rfsh we a16 a0 cs oe rfsh we a16 a0 cs oe rfsh we a18 a2 ras ce rd cas oe cashh we3 cashl we2 caslh we1 casll we0 figure 7.36 example of pseudo-sram connection (1-mbit pseudo-sram) .com .com .com .com 4 .com u datasheet
191 a18 a0 ce oe rfsh we a18 a0 cs oe rfsh we a18 a0 cs oe rfsh we a18 a0 cs oe rfsh we a20 a2 ras ce cas oe cashh we3 cashl we2 caslh we1 casll we0 figure 7.37 example of pseudo-sram connection (4-mbit pseudo-sram) .com .com .com .com 4 .com u datasheet
192 7.7.2 basic timing figure 7.38 shows the basic pseudo-sram access timing. tp is the precharge cycle, tr is the ce assert cycle, tc1 is the write data output and bs assert cycle, and tc2 is the read data fetch cycle. when accesses are consecutive, precharge cycle tp overlaps the tc2 cycle of the previous access, so reads or writes can be performed in a minimum of 3 cycles each. tp tr tc1 tc2 ckio read write a26 a1 cs3 bs ce oe rd wen d0 oe rd wen d0 figure 7.38 basic access timing .com .com .com .com 4 .com u datasheet
193 7.7.3 wait state control when the clock frequency is raised, 1 cycle may not always be sufficient for all states to end, as in basic access. setting bits in wcr and mcr enables the state to be lengthened. figure 7.39 shows an example of lengthening a state using settings. the tp cycle that ensures a sufficient ce precharge time can be extended to 2 cycles by insertion of a tpw cycle by means of the trp bit in mcr. the number of cycles between bs assert and the end of access can be extended from 2 to 4 cycles by setting the w31/w30 bits in wcr. when a value other than 00 is set in w31 and w30, the external wait pin wait is also sampled, so the number of cycles can be further increased. figure 7.40 shows the timing of wait state control using the wait pin. in either case, when consecutive accesses occur, the tp cycle of one access overlaps the tc2 cycle of the previous access. the rcd bit in mcr is set to 0 for a pseudo-sram interface, but when set to 1, the number of cycles from the ce assert to the bs assert or write data output becomes 2. tp tr tc1 tw tc2 tpw ckio read write a26 a1 cs3 bs ce oe rd wen d0 oe rd wen d0 figure 7.39 wait state timing .com .com .com .com 4 .com u datasheet
194 tp tc1 tw twx tc2 tr ckio read write a26 a1 cs3 bs ce oe rd wen d0 oe rd wen wait d0 figure 7.40 external wait state timing 7.7.4 burst access in addition to normal access, in which ce is alternatively asserted and negated at every access, when consecutive accesses are to the same row address the pseudo-sram can access data at high speed by changing only the column address and leaving ce asserted. this function is called the static column mode. select between ordinary access and burst mode using static column mode by setting the burst enable bit (be) in mcr. figure 7.41 shows the timing of burst operation using static column mode. when performing burst access, cycles can be inserted using the wait state control function. .com .com .com .com 4 .com u datasheet
195 tp tr tc1 tc2 tc1 tc2 ckio read write a26 a1 cs3 bs ce oe rd wen d0 oe rd wen d0 only column address changes figure 7.41 static column mode 7.7.5 refreshing the bsc has a function for controlling pseudo-sram refreshing. by setting the mcr? rmode bit to 0 and rfsh bit to 1, distributed refreshing using the auto-refresh cycle can be performed. refreshes are performed at the interval determined by the input clock selected with cks2?ks0 in rtcsr and the value set in rtcor. set the values of rtcor and cks2?ks0 so they satisfy the refresh interval specifications of the pseudo-sram being used. first, set rtcor, rtcnt and the rmode and rfsh bits in mcr, then set the cks2?ks0 bits. when a clock is selected with the cks2?ks0 bits, rtcnt starts counting up from the value at that time. the rtcnt value is constantly compared to the rtcor value and a request for a refresh is made when the two match, starting an auto-refresh. rtcnt is cleared to 0 at that time and the count up starts again. figure 7.42 shows the timing for the auto-refresh cycle. .com .com .com .com 4 .com u datasheet
196 the number of oe assert cycles for auto-refresh is specified by the tras bit in mcr. as with ordinary accesses, the specification of the precharge time from oe negation to the next ce assert follows the setting of the trp bit in mcr. tp trr trc trc tre ckio cs3 ce bs oe rfsh rd wen figure 7.42 auto-refresh the self-refresh mode is initiated in the pseudo-sram when the rfsh signal stays low for a prescribed period of time. a self-refresh is started by setting the rmode and rfsh bits to 1. during the self-refresh, the pseudo-sram cannot be accessed. to clear self-refreshing, set either the rmode or rfsh bit to 0. after self-refresh mode is cleared, issuing of commands is inhibited for 1 auto-refresh cycle. if more time than this is required to return from self-refresh, write the program so that there are no accesses to the pseudo-sram, including auto-refreshes, during this period. figure 7.43 shows the self-refresh timing. after self-refreshing is cleared, immediately set the pseudo-sram so that auto-refresh is performed in the correct interval. this ensures correct self-refresh clearing and data retention. when time is required between clearing the self-refreshing and initiating the auto-refresh mode, this time must be reflected in the initial rtcnt setting. .com .com .com .com 4 .com u datasheet
197 tp trr trc trc tre ckio cs3 ce bs oe rfsh rd wen figure 7.43 self-refresh 7.7.6 power-on sequence when pseudo-sram is used after the power is turned on, there is a requirement for a waiting period during which accesses cannot be performed (100 s minimum) followed by the prescribed number of dummy auto-refresh cycles (usually 8). the bus state controller does not perform any special operations for the power-on reset, so the required power-on sequence must be implemented by the initialization program executed after a power-on reset. 7.8 burst rom interface set the bstrom bit in bcr1 to set the cs0 space for connection to burst rom. the burst rom interface is used to permit fast access to roms that have the nibble access function. figure 7.44 shows the timing of nibble accesses to burst rom. set for two wait cycles. the access is basically the same as an ordinary access, but when the first cycle ends, only the address is changed. the cs0 signal is not negated, enabling the next access to be conducted without the t1 cycle required for ordinary space access. from the second time on, the t1 cycle is omitted, so access is 1 cycle faster than ordinary accesses. currently, the nibble access can only be used on 4-address rom. this function can only be utilized for word or longword reads to 8-bit rom and longword reads to 16-bit rom. mask roms have slow access speeds and require 4 instruction fetches for 8-bit widths and 16 accesses for cache fills. limited support of nibble access was thus added to alleviate this problem. when connecting to an 8-bit width rom, a maximum of 4 consecutive accesses are performed; when connecting to a 16-bit width rom, a maximum of 2 consecutive accesses are performed. figure 7.45 shows the relationship between data width and access size. for cache fills and dmac 16-byte transfers, longword accesses are repeated 4 times. .com .com .com .com 4 .com u datasheet
198 when one or more wait states are set for a burst rom access, the wait pin is sampled. when the burst rom is set and 0 specified for waits, there are 2 access cycles from the second time on. figure 7.46 shows the timing. t1 tw1 tw2 t2 tw1 tw2 t2 ckio a26 a0 rd/ wr cs0 rd d0 bs figure 7.44 burst rom nibble access (2 wait states) .com .com .com .com 4 .com u datasheet
199 t1 tw t2 tw t2 tw t2 tw t2 8-bit bus-width longword access t1 tw t2 tw t2 8-bit bus-width access t1 tw t2 8-bit bus-width byte access t1 tw t2 tw t2 16-bit bus-width longword access t1 tw t2 16-bit bus-width word access t1 tw t2 16-bit bus-width byte access t1 tw t2 32-bit bus-width longword access t1 tw t2 32-bit bus-width word access t1 tw t2 32-bit bus-width byte access figure 7.45 data width and burst rom access (1 wait state) .com .com .com .com 4 .com u datasheet
200 t1 t2 t1 t2 ckio a26 a0 rd/ wr cs0 rd d0 bs figure 7.46 burst rom nibble access (no wait states) 7.9 waits between access cycles because operating frequencies have become high, when a read from a slow device is completed, data buffers may not go off in time to prevent data conflicts with the next access. this lowers device reliability and causes errors. to prevent this, a function has been added to avoid data conflicts that memorizes the space and read/write state of the preceding access and inserts a wait in the access cycle for those cases in which problems are found to occur when the next access starts up. checks are performed in two cases: if a read cycle is followed immediately by a read access to a different cs space, and if a read access is followed immediately by a write from the sh7604. when the sh7604 is writing continuously, if the format is always to have the direction of the data from the sh7604 to other memory, there are no particular problems. neither is there any particular problem if the following read access is to the same cs space, since data is output from the same data buffer. the number of idle cycles to be inserted into the access cycle when reading from another cs space, or performing a write, after a read from the cs3 space, is specified by the iw31 and iw30 bits in wcr. likewise, iw21 and iw20 specify the number of idle cycles after cs2 reads, iw11 and iw10 specify the number after cs1 reads, and iw01 and iw00 specify the number after cs0 reads. from 0 to 2 cycles can be specified. when there is already a gap between accesses, the number of empty cycles is subtracted from the number of idle cycles before insertion. when a write cycle is performed immediately after a read access, 1 wait cycle is inserted even when 0 is specified for waits between access cycles. .com .com .com .com 4 .com u datasheet
201 when the sh7604 shifts to a read cycle immediately after a write, the write data becomes high impedance when the clock rises, but the rd signal, which indicates read cycle data output enable, is not asserted until the clock falls. the result is that no waits are inserted into the access cycle. when bus arbitration is being performed, an empty cycle is inserted for arbitration, so no wait is inserted between cycles. t1 t2 twait t1 t2 twait t1 t2 ckio a26 a0 rd/wr csm csn rd d31 d0 bs csm space read specification of waits between csm accesses (reading different spaces) specification of waits between csn accesses (read followed by write) csn space read csn space write figure 7.47 waits between access cycles 7.10 bus arbitration the sh7604 has a bus arbitration function that, when a bus release request is received from an external device, releases the bus to that device after the bus cycle being executed is completed. in addition, it also has a bus arbitration function for supporting the connection of two processors. these are connected to each other as master and slave through bus arbitration, which enables a multiprocessor system to be implemented with a minimum of hardware. there are three modes for bus arbitration: master mode, partial-share master mode, and slave mode. master mode keeps the bus under normal conditions and permits other devices to use the bus by releasing it when they request its use. the slave mode normally does not have the bus. the bus is requested when an external bus access cycle comes up and then releases the bus when the .com .com .com .com 4 .com u datasheet
202 access is completed. the partial-share master mode only shares cs2 space with external devices. for the cs2 space, the mode is slave mode; for other spaces, the bus is held constantly without any bus arbitration. which cs space of the chip in master mode the cs2 space of the chip in partial-share master mode is allocated to, is determined by external circuitry. master or slave mode can be specified using external mode pins. partial-share master mode is reached from master mode by a software setting. see section 3, oscillator circuits and operating modes, for the external mode pin settings. when a device in master or slave mode does not have the bus, the bus goes to high impedance, so the master mode chip and slave mode chips can be connected directly. in the partial-share master mode, the bus is always driven, so an external buffer is needed to connect to a master bus. in master mode, a connection to an external device requesting the bus can be substituted for the slave mode connection. in the following explanation, external devices requesting the bus are also called slaves. the sh7604 has two internal bus masters, the cpu and the dmac. when synchronous dram, dram or pseudo-sram is connected and refresh control is performed, the refresh request becomes a third master. in addition to these, there are also bus requests from external devices while in the master mode. the priority for bus requests when they occur simultaneously is, highest to lowest, refresh requests, bus requests from external devices, dmac and cpu. when the bus is being passed between slave and master, all bus control signals are negated before the bus is released to prevent erroneous operation of the connected devices. once the bus is received, the bus control signals change from negated to bus driven. the master and slave passing the bus between them drive the same signal values, so output buffer conflict is avoided. turning the output buffer off for the bus control signals on the side that releases the bus and on at the side acquiring the bus can eliminate the high impedance period of the signals. it is usually not necessary to insert a pull-up resistance into these control signals to prevent malfunction caused by external noise while they are at high impedance. bus permission is granted at the end of the bus cycle. when the bus is requested, the bus is released immediately if there is no ongoing bus cycle. if there is a current bus cycle, the bus is not released until the bus cycle ends. even when there does not appear to be an ongoing bus cycle when seen from outside the sh7604, it cannot be determined whether or not the bus will be released immediately when a bus control signal such as a csn signal is seen, since an internal bus cycle, such as inserting a wait between access cycles, may have been started. the bus cannot be released during burst transfers for cache fills or 16-byte dmac block transfers. likewise, the bus cannot be released between the read and write cycles of a tas instruction. arbitration is also not performed between multiple bus cycles produced by a data width smaller than the access size, such as a longword access to an 8-bit data width memory. bus arbitration is performed between external vector fetch, pc save, and sr save cycles during interrupt handling, which are all independent accesses. because the cpu in the sh7604 is connected to cache memory by a dedicated internal bus, cache memory can be read even when the bus is being used by another bus master on the chip or .com .com .com .com 4 .com u datasheet
203 externally. writing from the cpu always produces a write cycle externally since the write-through system is used by the sh7604 for the cache. when an external bus address monitor is not specified by the user break controller, the internal bus that connects the cpu, dmac and on-chip peripheral modules can operate in parallel to the external bus. this means that both read and write accesses from cpu to on-chip peripheral modules and from dmac to on-chip peripheral module are possible. if an external bus address monitor is specified, the internal bus will be used for address monitoring when the bus is passed to the external bus master, so accesses to on-chip peripheral modules by the cpu and dmac must wait for the bus to be returned. 7.10.1 master mode master mode processors keep the bus unless they receive a bus request. when a bus release request ( brls ) assertion (low level) is received from an external device, buses are released and a bus grant ( bgr ) is asserted (low level) as soon as the bus cycle being executed is completed. when it receives a negated (high level) brls signal, indicating that the slave has released the bus, it negates the bgr (to high level) and begins using the bus. when the bus is released, all output and i/o signals related to the bus interface are changed to high impedance, except for the cke signal for the synchronous dram interface, the bgr signal for bus arbitration, and dma transfer control signals dack0 and dack1. when the dram or pseudo-sram has finished precharging, the bus is released. the synchronous dram also issues a precharge command to the active bank or banks. after this is completed, the bus is released. the specific bus release sequence is as follows. first, the bus use enable signal is asserted synchronously with the fall of the clock. half a cycle later, the address bus and data bus become high impedance synchronous with the rise of the clock. thereafter the bus control signals ( bs , csn , ras , cas , wen , rd , rd/ wr , ivecf ) become high impedance with the fall of the clock. all of these signals are negated at least 1.5 cycles before they become high impedance. sampling for bus request signals occurs at the clock fall. the sequence when the bus is taken back from the slave is as follows. when the negation of brls is detected at a clock fall, bgr is immediately negated and the master simultaneously starts to drive the bus control signals. the address bus and data bus are driven starting at the next clock rise. the bus control signals are asserted and the bus cycle actually starts from the same clock rise at which the address and data signals are driven, at the earliest. figure 7.48 shows the timing of bus arbitration in master mode. .com .com .com .com 4 .com u datasheet
204 address data bs rd wen csn wr back breq bs rd wen csn wr bgr brls figure 7.48 bus arbitration when a refresh request is generated in the sh7604 while bgr is asserted and the bus released, the bgr may or may not be negated. case in which bgr is negated: if access processing for an external device has not been started before the refresh request is generated, the bgr signal will be negated even while the brls signal is asserted. even though the bgr signal is negated, a refresh operation will not begin unless the brls signal is negated. refreshing begins as soon as brls is negated. .com .com .com .com 4 .com u datasheet
205 ckio brls bgr figure 7.49 case in which bgr is negated case in which bgr is not negated: if access processing for an external device has been initiated before the refresh request is generated, and the device is waiting to acquire the bus, the bgr signal will not be negated. after the brls signal is negated, refreshing begins after completion of the access involving the external device that was waiting for the bus. ckio brls bgr figure 7.50 case in which bgr is not negated when the sh7604 is being used in slave mode, the bus is released as soon as the bus access cycle ends, but in the case of a slave designed by the user, multiple consecutive bus accesses may be attempted in order to reduce the arbitration overhead. to ensure dependable refreshing in this case, the design should provide for the bus to be released to prevent the slave holding the bus for longer than the refresh cycle. 7.10.2 slave mode in slave mode, the bus is usually released. external devices cannot be accessed unless the bus arbitration sequence is performed to capture the bus. during a reset, the bus is released and the bus arbitration sequence starts from the reset vector fetch. the breq signal is asserted (to low level) synchronously with the clock fall for capturing the bus. the assertion of the back signal (to low level) is sampled at the clock fall. when a back .com .com .com .com 4 .com u datasheet
206 assertion is detected, the bus control signals are immediately driven at the negate level. thereafter the address and data bus drivers turn on at the following clock rise and the bus cycle starts. the last signal negated when the access cycle ended is synchronized with the clock rise. half a cycle after the clock rise, the breq signal is negated, the master notified that the bus is released, and one cycle later the address and data output buffers turned off (high impedance). at the following clock fall, the control signals become high impedance. figure 7.48 shows the bus arbitration timing for slave mode. when the slave access cycle is for dram, synchronous dram or pseudo-sram, the bus is released when the memory precharge finishes, just as for master mode. since refresh control is handled by the master mode device, any refresh control setting performed in the slave mode is ignored. figure 7.51 shows an example of master mode and slave mode connections. ckio brls bgr csn bs wr rd wen ras cas ivecf wait a0 d31 d0 cs bs wr rd wen ivecf wait cs oe wen cs ras cas we breq back csn bs wr rd wen ras cas ivecf wait a0 d31 d0 interfaces with other devices sram synchronous dram slave mode master mode figure 7.51 connection between master and slave devices 7.10.3 partial-share master mode in partial-share master mode, only the cs2 space is shared with other devices. other cs spaces can always be accessed. to set partial-share master mode, set to master mode using the external mode pins and then set the pshr bit in bcr to 1 in the power-on reset initialization procedure. .com .com .com .com 4 .com u datasheet
207 during a manual reset, the values of the bus state controller setting registers are held, so they do not need to be set again. partial-share master mode is designed to be used with a chip in master mode. figure 7.52 shows an example of connections between a partial-share master mode and master mode sh7604. on the master mode side, the cs3 space is connected to synchronous dram and the cs0 space to rom. on the partial-share master mode side, the cs0 space is connected to rom, the master side synchronous dram is connected to the cs2 space, and the cs3 space is connected to dedicated synchronous dram. the partial-share master is also connected through the cs2 space to the master synchronous dram so it can be accessed. the master, however, cannot access devices on the partial-share master side. there is a buffer for addresses and control signals and a buffer for data located between the partial-share master and the master. they are controlled by a buffer control circuit. the buffers latch signals synchronous to the clock rise and match timing, so an ac operating margin is assured. when the master side synchronous dram is read from the partial- share master, however, address and control line output requires an extra cycle, and input of read data requires an extra cycle. the cas latency setting within the bus controller should be 2 higher than the actual synchronous dram cas latency. if the clock cycle is sufficiently long relative to the time for addresses, control signals and write signals from the partial-share master to reach the synchronous dram on the master side through the buffer and to the time for read data from the synchronous dram on the master side to reach the partial-share master through the buffer, if the respective setup time limits can be satisfied, then there is no need to delay by one cycle clock signal synchronously with the clock. in this case, the previously described latch is not needed. when a processor in the partial-share master mode accesses the cs2 space, it performs the following procedure. the breq signal is asserted at the clock fall to request the bus from the master. the back signal is sampled at every clock fall, and when an assertion is received, the access cycle starts at the next clock rise. after the access ends, breq is negated at the clock fall. control of the buffer when a cs2 space device is being accessed from the partial-share master references the breq and back signals. notification that the bus is enabled for use is conducted by the back connected to the partial-share master, but the back signal may be negated while the bus is in use when the master requires the bus back to service a refresh or the like. for this reason, the breq signal must be monitored to see whether the partial-share master can continue using the bus after back is asserted. for address buffers, after the address buffer is turned on by the detection of a back assertion, the buffer remains on until breq is negated. when breq is negated, the buffer goes off. when the buffer is slow going off and it conflicts with the start of the access cycle at the master, the breq signal output from the partial-share master as part of the buffer control circuit must be delayed a clock and input to the brls signal. when the bus is released after the cs2 space is accessed in partial-share master mode, the bus will be released after waiting for the time required for auto-precharge if the cs2 space was synchronous dram. other spaces always have the bus themselves, so there is no precharge of cs3 space memory upon release after a cs2 space bus request, even when dram, synchronous dram or pseudo-sram is connected to the cs3 space. partial-share master mode does not refresh cs2 (it is ignored). .com .com .com .com 4 .com u datasheet
208 rom master mode synchronous dram rom partial-share master mode synchronous dram interfaces with other devices buffer control ck en ck en dir ckio brls bgr bs rd ivecf csn ras cas wr wen a0 cke wait d0 ck cke cs ras cas we cs oe bs rd ivecf cs wen wen wait cs oe cs ras cas we breq back bs rd ivecf csn ras cas wr wen a0 cke wait d0 figure 7.52 connection between master and partial-share master devices .com .com .com .com 4 .com u datasheet
209 7.10.4 external bus address monitor the master and slave modes have a function to generate break interrupts and monitor the external bus access cycle using the user break controller. the bus cycle is monitored by sampling the external bus every time the clock rises while the bus is released. if the bs signal is found to be asserted (low level) when sampling is performed, the address at that time (a26?0) and read/write signal rd/ wr are fetched and compared as the access address and access type (read or write). when an external device has captured the bus and the dram or synchronous dram is in an access cycle, the following points are important to make the address monitor function correctly. bs goes low in the dram or synchronous dram access cycle in synchronization with the cycle that outputs the column address. because only the address of the cycle in which the bs signal is low is fetched and compared, even access to memories like these that multiplex addresses requires outputting of the row address in the upper address bits. one of the bits of the address signal in the column address output cycle in synchronous dram is used to specify the bank address, while the other bit is used to specify whether to perform an auto-precharge. these always cause breaks on the compared address, so mask these two bits when setting the comparison address. the masked bit position is described in the section 7.5.2, address multiplexing. 7.10.5 master/slave coordination roles must be shared between the master and slave to control system resources without contradictions. dram, synchronous dram and pseudo-sram must be initialized before use. when using standby operation to lower power consumption, the load must also be shared. this sh7604 was designed with the idea that the master mode device would handle all controls, such as initialization, refreshing, and standby control. when a 2-processor structure of connected master and slave is used, all processing except for direct accesses to memory is controlled by the master. when master mode is combined with partial-share master mode, the partial-share master mode processor handles initialization, refreshing, and standby control for all cs spaces connected to it except for the cs2 space. the master initializes memory connected directly to it. the hardware or software sequence should be designed so that there are no slave-side processor accesses until memory that requires initialization before use such as dram, synchronous dram and pseudo-sram has completed its initialization. one method is to install an external circuit that clears slave resets from the master. another is to have the master write a flag when initialization is complete to an sram or the like that does not require initialization, and then not to start access until this flag is acknowledged by the slave. a third method is to install an external circuit that can send an interrupt from master to slave and clear the slave? standby state with an interrupt from the master to the slave when initialization ends. in standby mode or the like when synchronous dram and pseudo-sram are in self-refresh mode, memory is not precharged until the mode is cleared, so the master cannot release the bus. the design should provide for the master to put the slave to sleep before self-refresh mode starts .com .com .com .com 4 .com u datasheet
210 or otherwise prevent the slave access cycle from starting, which prevents the slave from producing a bus release request. the slave accesses these types of memories after the master finishes any processing necessary when the self-refresh mode is cleared, such as refresh settings. 7.11 other topics 7.11.1 resets the bus state controller is completely initialized only in a power-on reset. all signals are immediately negated, regardless of where in the bus cycle the sh7604 is, and the output buffer is turned off if the bus arbitration mode is slave. signal negation is simultaneous with turning the output buffer off. all control registers are initialized. in standby mode, sleep mode, and a manual reset, no bus state controller control registers are initialized. when a manual reset is performed, any executing bus cycles are completed, and then the sh7604 waits for an access. when a cache fill or 16-byte dmac transfer is executing, the cpu or dmac that is the bus master ends the access in a longword unit, since the access request is canceled by the manual reset. this means that when a manual reset is executed during a cache fill, the cache contents can no longer be guaranteed. during a manual reset, the rtcnt does not count up, so no refresh request is generated, and a refresh cycle is not initiated. to preserve the data of the dram, synchronous dram or pseudo-sram, the pulse width of the manual reset must be shorter than the refresh interval. master mode chips accept arbitration requests even when a manual reset signal is asserted. when a reset is executed only for the chip in master mode while the bus is released, the bgr signal is negated to indicate this. if the brls signal is continuously asserted, the bus release state is maintained. 7.11.2 access as seen from the cpu or dmac the sh7604 is internally divided into three buses: cache, internal, and peripheral. the cpu and cache memory are connected to the cache bus, the dmac and bus state controller are connected to the internal bus, and the low-speed peripherals and mode registers are connected to the peripheral bus. the user break controller is connected to both the cache bus and the internal bus. the internal bus can be accessed from the cache bus, but not the other way around. the peripheral bus can be accessed from the internal bus, but not the other way around. this results in the following. data cannot be written from the dmac to cache memory. when the dmac causes a write to memory, the contents of memory and the cache contents will be different. to rewrite the contents of memory, the cache memory must be purged by software if the possibility exists that the data for that address exists in the cache. .com .com .com .com 4 .com u datasheet
211 when the cpu starts a read access to a cache area, it first takes a cycle to find the cache. if there is data in the cache, it fetches it and completes the access. if there is no data in the cache, a cache data fill is performed via the internal bus, so four consecutive longword reads occur. for misses that occur when byte or word operands are accessed or branches occur to odd word boundaries (4n + 2 addresses), filling is always performed by longword accesses on the chip-external interface. in the cache-through area, the access is to the actual access address. when the access is an instruction fetch, the access size is always longword. for cache-through areas and on-chip peripheral module read cycles, after an extra cycle is added to determine the cycle, the read cycle is started through the internal bus. read data is sent to the cpu through the cache bus. when word write cycles access the cache area, the cache is searched. when the data of the relevant address is found, it is written here. in parallel to this, the actual writing occurs through the internal bus. when the right to use the internal bus is held, the cpu is notified that the write is completed without waiting for the actual writing to the on-chip peripheral module or off the chip to end. when the right to use the internal bus is not held, as when it is being used by the dmac or the like, there is a wait until the bus is acquired before the cpu is notified of completion. accesses to cache-through areas and on-chip peripheral modules work the same as in the cache area, except for the cache search and write. because the bus state controller has one level of write buffer, the internal bus can be used for another access even when the chip-external bus cycle has not ended. after a write has been performed to low-speed memory off the chip, performing a read or write with an on-chip peripheral module enables an access to the on-chip peripheral module without having to wait for the completion of the write to low-speed memory. during reads, the cpu always has to wait for the end of the operation. to immediately continue processing after checking that the write to the device of actual data has ended, perform a dummy read access to the same address consecutively to check that the write has ended. the bus state controller? write buffer functions in the same way during accesses from the dmac. a dual-address dma transfer thus starts in the next read cycle without waiting for the end of the write cycle. when both the source address and destination address of the dma are external spaces to the chip, however, it must wait until the completion of the previous write cycle before starting the next read cycle. .com .com .com .com 4 .com u datasheet
212 7.11.3 emulator when using the sh7604? emulator, operation differs from real chip operation in the following ways. to get trace data with the emulator, all accesses performed by the cpu and dmac must be output externally. it is not possible to completely analyze program execution or the contents of the data accessed with only traces of access cycles performed exterior to the chip. reads of the cache from the cpu can be performed using only the cache bus, but the access address and data read must be able to use the internal bus and external bus to be output externally. the external bus is not needed to access on-chip peripheral modules with the cpu or dmac, but it is needed to output trace data. this means that when the emulator is used in the trace data fetch mode, internal access operations of the cpu or dmac are not performed in parallel with the external bus cycle, so extra execution time is required compared to actual chips. parallel execution of accesses that follow writing to external destinations also should be executed after writing is completed to carry out traces. to precisely measure the actual execution time, an actual chip rather than an emulator should be used. .com .com .com .com 4 .com u datasheet
213 section 8 cache 8.1 introduction 64 entries internal data bus internal address bus tag address match signal cache data bus way 0 way 1 way 2 way 3 cache address bus cache data array cache address array tag address lru information data (16 bytes/line) v v: valid bit figure 8.1 cache configuration the sh7604 incorporates 4 kbytes of 4-way cache memory of mixed instruction/data type. the sh7604 can also be used as 2-kbyte ram and 2-kbyte cache memory (mixed instruction/data type) by a setting in the cache control register ccr (two-way cache mode). ccr can specify that either instructions or data do not use cache. each line of cache memory consists of 16 bytes. cache memory is always updated in line units. four 32-bit accesses are required to update a line. since the number of entries is 64, the six bits (a9 to a4) in each address determine the entry. a four-way set associative configuration is used, so up to four different instructions/data can be stored in the cache even when entry addresses match. to efficiently use four ways having the same entry address, replacement is provided based on a pseudo-lru (least-recently used) replacement algorithm. .com .com .com .com 4 .com u datasheet
214 31 28 9 3 31964 0 byte address in line entry address tag address access space specification address address figure 8.2 address 8.2 cache control register (ccr) table 8.1 cache control register name abbrev. r/w initial value address cache control register ccr r/w h'00 h'fffffe92 the cache control register (ccr) is used for cache control. ccr must be set and the cache must be initialized before use. bit: 7 6 5 4 3 2 1 0 bit name: w1 w0 cp tw od id ce initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r r/w r/w r/w r/w r/w ? bits 7 and 6?ay specification (w1 to w0): w1 and w0 specify the way when an address array is directly accessed by address specification. bit 7: w1 bit 6: w0 description 0 0 way 0 (initial value) 1 way 1 1 0 way 2 1 way 3 ? bit 5?eserved: this bit always reads 0. the write value should always be 0. ? bit 4?ache purge (cp): cp is a cache purge bit. when 1 is written to cp, all cache entries and all valid bits and lru bits of the way are initialized to 0. after initialization is complete, the cp bit reverts to 0. the cp bit always reads 0. .com .com .com .com 4 .com u datasheet
215 bit 4: cp description 0 normal operation (initial value) 1 cache purge note: always read 0. ? bit 3?wo-way mode (tw): tw is the two-way mode bit. the cache operates as a four-way set associative cache when tw is 0 and as a two-way set associative cache and 2-kbyte ram when tw is 1. in the two-way mode, ways 2 and 3 are cache and ways 0 and 1 are ram. ways 0 and 1 are read or written by direct access of the data array according to address space specification. bit 3: tw description 0 four-way mode (initial value) 1 two-way mode ? bit 2?ata replacement disable (od): od is the bit for disabling data replacement. when this bit is 1, data fetched from external memory is not written to the cache even if there is a cache miss. cache data is, however, read or updated during cache hits. od is valid only when ce is 1. bit 2: od description 0 normal operation (initial value) 1 data not replaced even when cache miss occurs in data access ? bit 1?nstruction replacement disable (id): id is the bit for disabling instruction replacement. when this bit is 1, an instruction fetched from external memory is not written to the cache even if there is a cache miss. cache data is, however, read or updated during cache hits. id is valid only when ce is 1. bit 1: id description 0 normal operation (initial value) 1 data not replaced even when cache miss occurs in instruction fetch ? bit 0?ache enable (ce): ce is the cache enable bit. cache can be used when ce is set to 1. bit 0: ce description 0 cache disabled (initial value) 1 cache enabled .com .com .com .com 4 .com u datasheet
216 8.3 address space and the cache the address space is divided into six partitions. the cache access operation is specified by addresses. table 8.2 lists the partitions and their cache operations. for more information on address spaces, see section 7, bus state controller. note that the spaces of the cache area and cache-through area are the same. table 8.2 address space and cache operation addresses a31?29 partition cache operation 000 cache area cache is used when the ce bit in ccr is 1. 001 cache-through area cache is not used. 010 associative purge area cache line of the specified address is purged (disabled). 011 address array read/write area cache address array is accessed directly. 110 data array read/write area cache data array is accessed directly. 111 i/o area cache is not used. 8.4 cache operation 8.4.1 cache reads this section describes cache operation when the cache is enabled and data is read from the cpu. one of the 64 entries is selected by the entry address part of the address output from the cpu on the cache address bus. the tag addresses of ways 0 through 3 are compared to the tag address parts of the addresses output from the cpu. a match to the tag address of a way is called a cache hit. in proper use, the tag addresses of each way differ from each other, and the tag address of only one way will match. when none of the way tag addresses match, it is called a cache miss. tag addresses of entries with valid bits of 0 will not match in any case. when a cache hit occurs, data is read from the data array of the way that was matched according to the entry address, the byte address within the line, and the access data size. the data is then sent to the cpu. the address output on the cache address bus is calculated in the cpu? instruction execution phase and the results of the read are written during the cpu? write-back stage. the cache address bus and cache data bus both operate as pipelines in concert with the cpu? pipeline structure. from address comparison to data read requires 1 cycle; since the address and data operate as a pipeline, consecutive reads can be performed at each cycle with no waits. .com .com .com .com 4 .com u datasheet
217 ex cpu pipeline stage cache address bus cache data bus ma wb ex address a cache tag comparison address b ma ex address a data array read address b ex: instruction execution ma: memory access wb: write-back figure 8.3 read access in case of a cache hit when a cache miss occurs, the way for replacement is determined using the lru information, and the read address from the cpu is written in the address array for that way. simultaneously, the valid bit is set to 1. since the 16 bytes of data for replacing the data array are simultaneously read, the address on the cache address bus is output to the internal address bus and 4 longwords are read consecutively. access starts with whatever address output to the internal address bus will make the longword that contains the address to be read from the cache come last as the byte address within the line as the order + 4. the data read on the internal data bus is written sequentially to the cache data array. when the last data is written to the cache data array, it is simultaneously written to the cache data bus and the read data is sent to the cpu. the internal address bus and internal data bus also function as pipelines, just like the cache bus. .com .com .com .com 4 .com u datasheet
218 data array write cache tag comparison cache tag comparison ex cpu pipeline stage cache address bus cache data bus internal address bus internal data bus ma wb ex ma address a address a + 4 address b address a + 12 address a + 8 address a + 8 address a + 4 address a address a + 12 address a address a ex: instruction execution ma: memory access wb: write-back figure 8.4 read access in case of a cache miss .com .com .com .com 4 .com u datasheet
219 8.4.2 write access this cache is of the write-through type, and writing to external memory is performed regardless of whether or not there is a cache hit. the write address output to the cache address bus is used to compare to the tag address of the cache? address array. when they match, the write data output to the cache data bus in the following cycle is written to the data array. when they do not match, nothing is written to the cache data array. the write address is output to the internal address bus 1 cycle later than the cache address bus. the write data is similarly output to the internal data bus 1 cycle later than the cache data bus. the cpu waits until the writes onto the internal bus are completed. ex cpu pipeline stage cache address bus cache data bus internal address bus internal data bus ma ex address a cache tag comparison address b ma address a address b address a address b address a data array write ex: instruction execution ma: memory access figure 8.5 write access .com .com .com .com 4 .com u datasheet
220 8.4.3 cache-through access when reading or writing a cache-through area, the cache is not accessed. instead, the cache address value is output to the internal address bus. for read operations, the read data output to the internal address bus is fetched and output to the cache data bus. the read of the cache-through area is only performed on the address in question. for write operations, the write data on the cache data bus is output to the internal data bus. writes on the cache through area are compared to the address tag; except for the fact that nothing is written to the data array, the operation is the same as the write shown in figure 8.5. ex cpu pipeline stage cache address bus cache data bus internal address bus internal data bus ma wb ex ma address a address a address b address a address a ex: instruction execution ma: memory access wb: write-back figure 8.6 reading cache-through areas .com .com .com .com 4 .com u datasheet
221 8.4.4 the tas instruction the tas instruction reads data from memory, compares it to 0, and reflects the result in the t bit of the status register while setting the most significant bit to 1. it is an address for writing to the same address. reads from memory become cache-through operations even when the cache area is accessed. address tags are not compared. the updated value is written to memory through the internal data bus, but before that the address tag is compared and if there are any matching entries, a write is performed to the corresponding data array. data array write cache tag comparison ex cpu pipeline stage cache address bus cache data bus internal address bus internal data bus ma ex ma address a address a' address a address a address a' address a' address a' address a ex: instruction execution ma: memory access figure 8.7 tas instruction execution and the cache .com .com .com .com 4 .com u datasheet
222 8.4.5 pseudo-lru and cache replacement when a cache miss occurs during a read, the data of the missed address is read from 1 line (16 bytes) of memory and replaced. this makes it important to decide which of the ways to replace. it is likely that the way least recently used has the highest probability of being the next to be accessed. this algorithm for replacing ways is called the least recently used replacement algorithm, or lru. the hardware to implement it, however, is complex. for that reason, this cache uses a pseudo-lru replacement algorithm that keeps track of the order of way access and replaces the oldest way. six bits of data are used as the lru information. the bits indicate the access order for 2 ways, as shown in figure 8.8. when the value is 1, access occurred in the direction of the appropriate arrow in the figure. the direction of the arrow can be determined by reading the bit. all the arrows show the oldest access toward that way, which becomes the object of replacement. the access order is recorded in the lru information bits, so the lru information is rewritten when a cache hit occurs during a read, when a cache hit occurs during a write, and when replacement occurs after a cache miss. table 8.3 shows the rewrite values; table 8.4 shows how ways are selected for replacement. after a cache purge by ccr? cp bit, the lru information is completely zeroized, so the initial order used is way 3 way 2 way 1 way 0. thereafter the way is selected according to the order of access set by the program. since the replacement will not be correct if the lru gets an inappropriate value, the address array write function can be used to rewrite. when this is done, be sure not to write a value other than 0 as the lru information. when ccr? od bit or id bit is 1, neither will replace the cache even if a cache miss occurs during data read or instruction fetch. instead of replacing, the missed address data is read and directly transferred to the cpu. the two-way mode of the cache set by ccr? tw bit can only be implemented by replacing ways 2 and 3. comparisons of tag addresses of address arrays are carried out on all four ways even in two-way mode, so the valid bit of ways 1 and 0 must be zeroized prior to operation in the two-way mode. writing for the tag address and valid bit for cache replacement does not wait for the read from memory to be completed. when the memory access is aborted by a reset during replacement or the like, the cache contents and memory contents may be out of sync, so always perform a purge. .com .com .com .com 4 .com u datasheet
223 way 0 way 2 way 1 way 3 bit 5 bit 2 bit 3 bit 4 bit 1 bit 0 figure 8.8 lru information and access sequence table 8.3 lru information after update bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 way 0 0 0 0 way 1 1 00 way 2 1 1 0 way 3 1 11 : holds the value before update. table 8.4 selection conditions for replaced way bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 way 0 1 1 1 way 1 0 11 way 2 0 0 1 way 3 0 00 : don t care. .com .com .com .com 4 .com u datasheet
224 8.4.6 cache initialization purges of the entire cache area can only be carried out by writing 0 to the cp bit in ccr. writing 1 to the cp bit initializes the valid bit of the address array and all bits of the lru information to 0. cache purges are completed in 1 cycle, but additional time is required for writing to ccr. always initialize the valid bit and lru before enabling the cache. when the cache is enabled, instruction reads are performed from the cache even during writing to ccr. this means that the prefetched instructions are read from the cache. to do a proper purge, write 0 to ccr? ce bit, then disable the cache and purge. since ccr? ce bit is cleared to 0 by a power-on reset or manual reset, the cache can be purged immediately by a reset. 8.4.7 associative purges associative purges invalidate 1 line (16 bytes) corresponding to specific address contents when the contents are in the cache. when the contents of shared addresses are rewritten by one cpu in a multiprocessor configuration, the other cpu cache must be invalidated if it also contains the address. when writing is performed to the address found by adding h'40000000 to the purged address, the valid bit of the entry storing the address prior to the addition is initialized to 0. 16 bytes are purged in each write, so a purge of 256 bytes of consecutive areas can be accomplished in 16 writes. access sizes when associative purges are performed should be longword. a purge of 1 line requires 2 cycles. associative purge: tag address 010 address entry address 31 9 3 0 19 6 34 28 figure 8.9 associative purge access 8.4.8 data array access the cache data array can be read or written directly via the data array read/write area. the access sizes for the data array may be byte, word or longword. data array accesses are completed in 1 cycle for both reads and writes. since only the cache bus is used, the operation can proceed in parallel even when another master, such as the dmac, is using the bus. the data array of way 0 is mapped on h'c0000000 to h'c00003ff, way 1 on h'c0000400 to h'c00007ff, way 2 on h'c0000800 to h'c0000bff and way 3 on h'c0000c00 to h'c0000fff. when the two-way mode is being used, the area h'c0000000 to h'c00007ff is accessed as 2 kbytes of on-chip ram. when the cache is disabled, the area h'c0000000 to h'c0000fff can be used as 4 kbytes of on-chip ram. .com .com .com .com 4 .com u datasheet
225 when the contents of the way being used as cache is rewritten using a data array access, the contents of external memory and cache will not match, so this method should be avoided. tag address 110 address entry address ba w 31 28 9 3 0 19 data 31 0 32 6 3 4 data data array read/write: ba: byte address within line w: way specification figure 8.10 data array access 8.4.9 address array access the address array of the cache can be accessed so that the contents fetched to the cache can be checked for purposes of program debugging or the like. the address array is mapped on h'60000000 to h'600003ff. since all of the ways are mapped to the same addresses, ways are selected by rewriting the w1 and w0 bits in ccr. the address array can only be accessed in longwords. when the address array is read, the tag address, lru information, and valid bit are output as data. when the address array is written to, the tag address and valid bit are written from the cache address bus. this requires that the write address be calculated according to the value to be written, then written. lru information is written from data, but 0 should always be written to prevent malfunctions. .com .com .com .com 4 .com u datasheet
226 011 address entry address 31 28 9 3 0 19 6 34 tag address data lru v 31 9 3 2 0 19 6 3112 lru information 31 9 3 0 22 6 4 data tag address 011 address entry address v 31 28 9 19 6 3112 address array read: address array write: 1 32 0 1 28 v: valid bit figure 8.11 address array access 8.5 cache use 8.5.1 initialization cache memory is not initialized in a reset. therefore, the cache must be initialized by software before use. cache initialization clears (to 0) the address array valid bit and all lru information. the address array write function can be used to initialize each line, but it is simpler to initialize it once by writing 1 to the cp bit in ccr. figure 8.12 shows how to initialize the cache. mov.w #h'fe92, r1 mov.b @r1, r0 ; and #h'fe, r0 ; mov.b #r0, @r1 ; cache disable or #h'10, r0 mov.b r0, @r1 ; cache purge or #h'01, r0 mov.b r0, r1 ; cache enable figure 8.12 cache initialization .com .com .com .com 4 .com u datasheet
227 8.5.2 purge of specific lines since the sh7604 has no snoop function (for monitoring data rewrites), specific lines of cache must be purged when the contents of cache memory and external memory differ as a result of an operation. for instance, when a dma transfer is performed to the cache area, cache lines corresponding to the rewritten address area must be purged. all entries of the cache can be purged by setting the cp bit in ccr to 1. however, it is efficient to purge only specific lines if only a limited number of entries are to be purged. an associative purge is used to purge specific lines. since cache lines are 16 bytes long, purges are performed in a 16-byte units. the four ways are checked simultaneously, and only lines holding data corresponding to specified addresses are purged. when addresses do not match, the data at the specified address is not fetched to the cache, so no purge occurs. ; purging 32 bytes from address r3 mov.l #h'40000000, r0 xor r1, r1 mov.l r1, @(r0, r3) add #16, r3 mov.l r1, @(r0, r3) figure 8.13 purging specific addresses when it is troublesome to purge the cache after every dma transfer, it is recommended that the od bit in ccr be set to 1 in advance. when the od bit is 1, the cache operates as cache memory only for instructions. however, when data is already fetched into cache memory, specific lines of cache memory must be purged for dma transfers. 8.5.3 cache data coherency the sh7604? cache memory does not have a snoop function. this means that when data is shared with a bus master other than the cpu, software must be used to ensure the coherency of data. for this purpose, the cache-through area can be used, the break function can be used in external bus cycles, or a cache purge can be performed with program logic. if the cache-through area is to be used, the data shared by the bus masters is placed in the cache- through area. this makes it easy to maintain data coherency, since access of the cache-through area does not fetch data into the cache. when the shared data is accessed repeatedly and the frequency of data rewrites is low, a lower access speed can adversely affect performance. to use the external bus cycle break function, the user break controller is used. set the user break controller to generate an interrupt when a write cycle is detected to any of the areas that have shared data. the interrupt handling routine purges the cache. since the cache is purged whenever a .com .com .com .com 4 .com u datasheet
228 rewrite is detected, data coherency can be maintained. when data that extends over multiple words, such as a structure, is rewritten, however, interrupts are generated at the rewrites, which can lower performance. this method is most appropriate for cases in which it is difficult to predict and detect the timing of data updates and the update frequency is low. to purge the cache using program logic, the data updates are detected by the program flow and the cache is then purged. for example, if the program inputs data from a disk, whenever reading of a unit (such as a sector) is completed, the buffer address used for reading or the entire cache is purged, thereby maintaining coherency. when data is to be handled between two processors, only flags to provide mutual notification of completion of data preparation or completion of a fetch are placed in the cache-through area. the data actually transferred is placed in the cache area and the cache is purged before the first data read to maintain the coherency of the data. when semaphores are used as the means of communication, data coherency can be maintained even when the cache is not purged by utilizing the tas instruction. the tas instruction is not read within the cache; the external access is always direct. this means that data can be synchronized with other masters when it is read. when the update unit it is small, specific addresses can be purged, so only the relevant addresses are purged. when the update unit is larger, it is faster to purge the entire cache rather than purging all the addresses in order, and then read in the data previously existing in the cache again from external memory. 8.5.4 two-way cache mode the 4-kbyte cache can be used as 2-kbyte ram and 2-kbyte mixed instruction/data cache memory by setting the tw bit in ccr to 1. ways 2 and 3 become cache, and ways 0 and 1 become ram. the cache and ram are initialized by setting the cp bit in ccr to 1. the valid bit and lru bits are cleared to 0. when the initial values of the lru information are set to 0, ways 3 and 2 are initially used, in that order. ways 3 and 2 are subsequently selected for replacement as specified by the lru information. the conditions for updating the lru information are the same as for four-way mode, except that the number of ways is two. when designated as 2-kbyte ram, ways 0 and 1 are accessed by data array access. figure 8.14 shows the address mapping. .com .com .com .com 4 .com u datasheet
229 h'c0000000 h'c00003ff h'c0000400 h'c00007ff way 0 way 1 h'00000000 h'ffffffff figure 8.14 address mapping of 2-kbyte ram in the two-way mode 8.5.5 usage notes standby : disable the cache before entering the standby mode for power-down operation. after returning from power-down, initialize the cache before use. cache control register : changing the contents of ccr also changes cache operation. the sh7604 makes full use of pipeline operations, so it is difficult to synchronize access. for this reason, change the contents of the cache control register while disabling the cache or after the cache is disabled. .com .com .com .com 4 .com u datasheet
230 .com .com .com .com 4 .com u datasheet
231 section 9 direct memory access controller (dmac) 9.1 overview the sh7604 includes a two-channel direct memory access controller (dmac). the dmac can be used in place of the cpu to perform high-speed data transfers between external devices equipped with dack (transfer request acknowledge signal), external memories, memory-mapped external devices, and on-chip peripheral modules (except for the dmac, bsc and ubc). using the dmac reduces the burden on the cpu and increases the operating efficiency of the chip as a whole. 9.1.1 features the dmac has the following features: ? number of channels: 2 ? address space: 4 gbytes in the architecture ? selectable data transfer unit: byte, word (2 bytes), longword (4 bytes) or 16-byte unit (16-byte transfers first perform four longword reads and then four longword writes) ? maximum transfer count: 16,777,216 (16m) transfers ? with cache hits, cpu instruction processing and dma operation can proceed in parallel ? the maximum transfer rate for synchronous dram burst transfers is 38 mbytes/sec (f = 28.7 mhz) ? single address mode transfers: either the transfer source or transfer destination (peripheral device) is accessed by a dack signal (selectable) while the other is accessed by address. one transfer unit of data is transferred in each bus cycle. devices that can be used in dma transfer: ? external devices with dack and memory-mapped external devices (including external memories) ? dual address mode transfers: both the transfer source and transfer destination are accessed by address. one transfer unit of data is transferred in two bus cycles. device combinations capable of transfer: ? two external memories ? external memory and memory-mapped external devices ? two memory-mapped external devices ? external memory and on-chip peripheral module (excluding the dmac, bsc and ubc). ? memory-mapped external devices and on-chip peripheral modules (excluding the dmac, bsc and ubc) .com .com .com .com 4 .com u datasheet
232 ? two on-chip peripheral modules (excluding the dmac, bsc and ubc) (access size permitted by a register of the peripheral module that is the transfer source or destination) ? transfer requests ? external requests (from dreq pins. dreq can be detected either by edge or by level, and either active-low or active-high can be selected) ? on-chip peripheral module requests (serial communication interface (sci)) ? auto-request (the transfer request is generated automatically within the dmac) ? selectable bus modes: cycle-steal mode or burst mode ? selectable channel priority levels: fixed or round-robin mode ? an interrupt request can be sent to the cpu when data transfer ends .com .com .com .com 4 .com u datasheet
233 9.1.2 block diagram figure 9.1 shows a block diagram of the dmac. dreqn rxi txi dackn dein dmac on-chip peripheral module peripheral bus external bus external rom external ram external i/o (memory mapped) external i/o (with acknowledge) bus controller iteration control register control start-up control request priority control interrupt control bus interface dmac module bus sarn darn tcrn chcrn dmaor vcrdman internal bus dmaor: dma operation register sarn: dma source address register darn: dma destination address register tcrn: dma transfer counter register chcrn: dma channel control register vcrdman: dma vector register dein: dma transfer end interrupt request to cpu rxi: on-chip sci receive-data-full interrupt transfer request txi: on-chip sci transmit-data-full interrupt transfer request n: 0 to 1 figure 9.1 dmac block diagram .com .com .com .com 4 .com u datasheet
234 9.1.3 pin configuration table 9.1 shows the dmac pins. table 9.1 dmac pin configuration channel name symbol i/o function 0 dma transfer request dreq0 i dma transfer request input from external device to channel 0 dma transfer request acknowledge dack0 o dma transfer request acknowledge output from channel 0 to external device 1 dma transfer request dreq1 i dma transfer request input from external device to channel 1 dma transfer request acknowledge dack1 o dma transfer request acknowledge output from channel 1 to external device 9.1.4 register configuration table 9.2 summarizes the dmac registers. the dmac has a total of 13 registers. each channel has six control registers. one control register is shared by both channels. .com .com .com .com 4 .com u datasheet
235 table 9.2 dmac registers channel name abbr. r/w initial value address access size *3 0 dma source address register 0 sar0 r/w undefined h'ffffff80 32 dma destination address register 0 dar0 r/w undefined h'ffffff84 32 dma transfer count register 0 tcr0 r/w undefined h'ffffff88 32 dma channel control register 0 chcr0 r/(w) *1 h'00000000 h'ffffff8c 32 dma vector number register n0 vcrdma0 r/(w) *1 undefined h'ffffffa0 32 dma request/response selection control register 0 drcr0 r/(w) *1 h'00 h'fffffe71 8 *3 1 dma source address register 1 sar1 r/w undefined h'ffffff90 32 dma destination address register 1 dar1 r/w undefined h'ffffff94 32 dma transfer count register 1 tcr1 r/w undefined h'ffffff98 32 dma channel control register 1 chcr1 r/(w) *1 h'00000000 h'ffffff9c 32 dma vector number register n1 vcrdma1 r/(w) *1 undefined h'ffffffa8 32 dma request/response selection control register 1 drcr1 r/(w) *1 h'00 h'fffffe72 8 *3 shared dma operation register dmaor r/(w) *2 h'00000000 h'ffffffb0 32 notes: 1. only 0 can be written to bit 1 of chcr0 and chcr1, after reading 1, to clear the flags. 2. only 0 can be written to bits 1 and 2 of the dmaor, after reading 1, to clear the flags. 3. access drcr0 and drcr1 in byte units. access all other registers in longword units. 9.2 register descriptions 9.2.1 dma source address registers 0 and 1 (sar0 and sar1) bit: 31 30 29 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w dma source address registers 0 and 1 (sar0 and sar1) are 32-bit read/write registers that specify the source address of a dma transfer. during a dma transfer, these registers indicate the next source address. (in single-address mode, sar is ignored in transfers from external devices with dack to memory-mapped external devices or external memory). in 16-byte unit transfers, always set the value of the source address to a 16-byte boundars (16n address). operation results .com .com .com .com 4 .com u datasheet
236 cannot be guaranteed if other values are used. the value after a reset is undefined. values are retained in standby mode and during module standbys. 9.2.2 dma destination address registers 0 and 1 (dar0 and dar1) bit: 31 30 29 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w dma destination address registers 0 and 1 (dar0 and dar1) are 32-bit read/write registers that specify the destination address of a dma transfer. during a dma transfer, these registers indicate the next destination address. (in single-address mode, dar is ignored in transfers from memory- mapped external devices or external memory to external devices with dack). the value after a reset is undefined. values are retained in standby mode and during module standbys. 9.2.3 dma transfer count registers 0 and 1 (tcr0 and tcr1) bit: 31 30 29 28 27 26 25 24 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 23 22 21 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w dma transfer count registers 0 and 1 (tcr0 and tcr1) are 32-bit read/write registers that specify the dma transfer count. the lower 24 of the 32 bits are valid. the value is written as 32 bits, including the upper eight bits. the number of transfers is 1 when the setting is h'00000001, 16,777,215 when the setting is h'00ffffff and 16, 777,216 (the maximum) when h'00000000 is set. during a dma transfer, these registers indicate the remaining transfer count. set the initial value as the write value in the upper eight bits. these bits always read 0. the initial value after a reset is undefined. values are retained in standby mode and during module standbys. for 16-byte transfers, set the count to 4 times the number of transfers. .com .com .com .com 4 .com u datasheet
237 9.2.4 dma channel control registers 0 and 1 (chcr0 and chcr1) bit: 31 30 29 19 18 17 16 bit name: initial value: 0 0 0 0 0 0 0 r/w: r r r r r r r bit: 15 14 13 12 11 10 9 8 bit name: dm1 dm0 sm1 sm0 ts1 ts0 ar am initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: al ds dl tb ta ie te de initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/(w)* r/w note: only 0 can be written, to clear the flag. dma channel control registers 0 and 1 (chcr0 and chcr1) are 32-bit read/write registers that control the dma transfer mode. they also indicate the dma transfer status. only the lower 16 of the 32 bits are valid. they are written as 32-bit values, including the upper 16 bits. write the initial values to the upper 16 bits. these bits always read 0. the registers are initialized to h'00000000 by a reset and in standby mode. values are retained during a module standby. ? bits 15 and 14?estination address mode bits 1, 0 (dm1, dm0): select whether the dma destination address is incremented, decremented or left fixed (in single address mode, dm1 and dm0 are ignored when transfers are made from a memory-mapped external device, on- chip peripheral module, or external memory to an external device with dack). dm1 and dm0 are initialized to 00 by a reset and in standby mode. values are retained during a module standby. .com .com .com .com 4 .com u datasheet
238 bit 15: dm1 bit 14: dm0 description 0 0 fixed destination address (initial value) 1 destination address is incremented (+1 for byte transfer size, +2 for word transfer size, +4 for longword transfer size, +16 for 16-byte transfer size) 1 0 destination address is decremented (? for byte transfer size, ? for word transfer size, ? for longword transfer size, ?6 for 16-byte transfer size) 1 reserved (setting prohibited) ? bits 13 and 12?ource address mode bits 1, 0 (sm1, sm0): select whether the dma source address is incremented, decremented or left fixed. in single address mode, sm1 and sm0 are ignored when transfers are made from an external device with dack to a memory-mapped external device, on-chip peripheral module, or external memory. for a 16-byte transfer, the address is incremented by +16 regardless of the sm1 and sm0 values. sm1 and sm0 are initialized to 00 by a reset and in standby mode. values are retained during a module standby. bit 13: sm1 bit 12: sm0 description 0 0 fixed source address (+16 for 16-byte transfer size) (initial value) 1 source address is incremented (+1 for byte transfer size, +2 for word transfer size, +4 for longword transfer size, +16 for 16-byte transfer size) 1 0 source address is decremented (? for byte transfer size, ? for word transfer size, ? for longword transfer size, +16 for 16-byte transfer size) 1 reserved (setting prohibited) ? bits 11 and 10?ransfer size bits (ts1, ts0): select the dma transfer size. when the transfer source or destination is an on-chip peripheral module register for which an access size has been specified, that size must be selected. during 16-byte transfers, set the transfer address mode bit for dual address mode. ts1 and ts0 are initialized to 00 by a reset and in standby mode. values are retained during a module standby. bit 11: ts1 bit 10: ts0 description 0 0 byte unit (initial value) 1 word (2-byte) unit 1 0 longword (4-byte) unit 1 16-byte unit (4 longword transfers) .com .com .com .com 4 .com u datasheet
239 ? bit 9?uto request mode bit (ar): selects whether auto-request (generated within the dmac) or module request (an external request or from the on-chip sci module) is used for the transfer request. the ar bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 9: ar description 0 module request mode (initial value) 1 auto-request mode ? bit 8?cknowledge/transfer mode bit (am): in dual address mode, this bit selects whether the dack signal is output during the data read cycle or write cycle. in single-address mode, it selects whether to transfer data from memory to device or from device to memory. the am bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 8: am description 0 dack output in read cycle/transfer from memory to device (initial value) 1 dack output in write cycle/transfer from device to memory ? bit 7?cknowledge level bit (al): selects whether the dack signal is an active-high signal or an active-low signal. the al bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 7: al description 0 dack is an active-low signal (initial value) 1 dack is an active-high signal ? bit 6?req select bit (ds): selects the dreq input detection method used. the ds bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 6: ds description 0 detected by level (initial value) 1 detected by edge ? bit 5?req level bit (dl): selects active-high or active-low for the dreq signal. the dl bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. .com .com .com .com 4 .com u datasheet
240 bit 5: dl description 0 when ds is 0, dreq is detected by low level; when ds is 1, dreq is detected by fall (initial value) 1 when ds is 0, dreq is detected by high level; when ds is 1, dreq is detected by rise ? bit 4?ransfer bus mode bit (tb): selects the bus mode for dma transfers. the tb bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 4: tb description 0 cycle-steal mode (initial value) 1 burst mode ? bit 3?ransfer address mode bit (ta): selects the dma transfer address mode. the ta bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 3: ta description 0 dual address mode (initial value) 1 single address mode ? bit 2?nterrupt enable bit (ie): determines whether or not to request a cpu interrupt at the end of a dma transfer. when the ie bit is set to 1, an interrupt (dei) request is setnt to the cpu when the te bit is set. the ie bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 2: ie description 0 interrupt disabled (initial value) 1 interrupt enabled ? bit 1?ransfer-end flag bit (te): indicates that the transfer has ended. when the value in the dma transfer count register (tcr) becomes 0, the dma transfer ends normally and the te bit is set to 1. this flag is not set if the transfer ends because of an nmi interrupt or dma address error, or because the dme bit of the dma operation register (dmaor) or the de bit was cleared. to clear the te bit, read 1 from it and then write 0. when the te bit is set, setting the de bit to 1 will not enable a transfer. the te bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. .com .com .com .com 4 .com u datasheet
241 bit 1: te description 0 dma has not ended or was aborted (initial value) cleared by reading 1 from the te bit and then writing 0 1 dma has ended normally (by tcr = 0) ? bit 0?ma enable bit (de): enables or disables dma transfers. in auto-request mode, the transfer starts when this bit or the dme bit in dmaor is set to 1. the nmif and ae bits in dmaor and the te bit must be all set to 0. in external request mode or on-chip peripheral module request mode, the transfer begins when the dma transfer request is received from the relevant device or on-chip peripheral module, provided this bit and the dme bit are set to 1. as with the auto-request mode, the te bit and the nmif and ae bits in dmaor must be all set to 0. the transfer can be stopped by clearing this bit to 0. the de bit is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 0: de description 0 dma transfer disabled (initial value) 1 dma transfer enabled 9.2.5 dma vector number registers 0 and 1 (vcrdma0, vcrdma1) bit: 31 30 29 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 r/w: r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: vc7 vc6 vc5 vc4 vc3 vc2 vc1 vc0 initial value: r/w: r/w r/w r/w r/w r/w r/w r/w r/w dma vector number registers 0 and 1 (vcrdma0, vcrdma1) are 32-bit read/write registers that set the dmac transfer-end interrupt vector number. only the lower eight bits of the 32 are effective. they are written as 32-bit values, including the upper 24 bits. write the initial values to the upper 24 bits. these bits are initialized to h'000000xx (last eight bits are undefined) by a reset and in standby mode. values are retained during a module standby. ? bits 31 to 8?eserved: these bits always read 0. the write value should always be 0. .com .com .com .com 4 .com u datasheet
242 ? bits 7 to 0?ector number bits 7? (vc7?c0): set the interrupt vector numbers at the end of a dmac transfer. interrupt vector numbers of 0?27 can be set. when a transfer-end interrupt occurs, exception handling and interrupt control fetch the vector number and control is transferred to the specified interrupt handling routine. the vc7?c0 bits are undefined upon reset and in standby mode. always write 0 to vc7. 9.2.6 dma request/response selection control registers 0 and 1 (drcr0, drcr1) bit: 7 6 5 4 3 2 1 0 bit name: rs1 rs0 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r/w r/w dma request/response selection control registers 0 and 1 (drcr0, drcr1) are 8-bit read/write registers that set the vector address of the dmac transfer request source. they are written as 8-bit values. they are initialized to h'00 by a reset, but retain their values in a module standby. ? bits 7 to 2?eserved ? bits 1 and 0?esource select bits 1 and 0 (rs1, rs0): specify which transfer request to input to the dmac. changing the transfer request source must be done when the dma enable bit (de) is 0. the rs1 and rs0 bits are initialized to 00 by a reset. bit 1: rs1 bit 0: rs0 description 0 0 dreq (external request) (initial value) 0 1 rxi (on-chip sci receive-data-full interrupt transfer request)* 1 0 txi (on-chip sci transmit-data-empty interrupt transfer request)* 1 1 reserved (setting prohibited) note: for rx2 and tx1, set for dual transfer mode. the dreq settings in chcr are ds = 1 and dl = 0. .com .com .com .com 4 .com u datasheet
243 9.2.7 dma operation register (dmaor) bit: 31 30 29 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 r/w: r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: pr ae nmif dmie initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r/w r/(w)* r/(w)* r/w note: only 0 can be written, to clear the flag. the dma operation register (dmaor) is a 32-bit read/write register that controls the dma transfer mode. it also indicates the dma transfer status. only the lower four of the 32 bits are valid. dmaor is written as a 32-bit value, including the upper 28 bits. write the initial values to the upper 28 bits. these bits always read 0. dmaor is initialized to h'00000000 by a reset and in standby mode. ? bits 31 to 4?eserved: these bits always read 0. the write value should always be 0. ? bit 3?riority mode bit (pr): selects the priority level between channels when there are transfer requests for multiple channels. it is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 3: pr description 0 fixed priority (channel 0 > channel 1) (initial value) 1 round-robin (top priority shifts to bottom after each transfer. the priority for the first dma transfer after a reset is channel 1 > channel 0) ? bit 2?ddress error flag bit (ae): this flag indicates that an address error has occurred in the dmac. when the ae bit is set to 1, dma transfer cannot be enabled even if the de bit in the dma channel control register (chcr) is set to 1. to clear the ae bit, read 1 from it and then write 0. operation is performed up to the dmac transfer being executed when the address error occurred. ae is initialized to 0 by a reset and in standby mode. bit 2: ae description 0 no dmac address error (initial value) to clear the ae bit, read 1 from it and then write 0 1 address error by dmac .com .com .com .com 4 .com u datasheet
244 ? bit 1?mi flag bit (nmif): this flag indicates that an nmi interrupt has occurred. when the nmif bit is set to 1, dma transfer cannot be enabled even if the de bit in chcr and the dme bit are set to 1. to clear the nmif bit, read 1 from it and then write 0. ends after the dmac operation executing when the nmi comes in (operation goes to destination). when the nmi interrupt is input while the dmac is not operating, the nmif bit is set to 1. the nmif bit is initialized to 0 by a reset or in the standby mode. values are held during a module standby. bit 1: nmif description 0 no nmif interrupt (initial value) to clear the nmif bit, read 1 from it and then write 0. 1 nmif has occurred ? bit 0?ma master enable bit (dme): enables or disables dma transfers on all channels. a dma transfer becomes enabled when the de bit in the chcr and the dme bit are set to 1. for this to be effective, however, the te bit in chcr and the nmif and ae bits must all be 0. when the dme bit is cleared, all channel dma transfers are aborted. dme is initialized to 0 by a reset and in standby mode. its value is retained during a module standby. bit 0: dme description 0 dma transfers disabled on all channels (initial value) 1 dma transfers enabled on all channels .com .com .com .com 4 .com u datasheet
245 9.3 operation when there is a dma transfer request, the dmac starts the transfer according to the predetermined channel priority; when the transfer-end conditions are satisfied, it ends the transfer. transfers can be requested in three modes: auto-request, external request, and on-chip module request. a transfer can be in either single address mode or dual address mode. the bus mode can be either burst or cycle-steal. 9.3.1 dma transfer flow after the dma source address registers (sar), dma destination address registers (dar), dma transfer count registers (tcr), dma channel control registers (chcr), dma vector number registers (vcrdma), dma request/response selection control registers (drcr), and dma operation register (dmaor) are initialized (initializing sets each register so that ultimately the condition (de = 1, dme = 1, te = 0, nmif = 0, ae = 0) is satisfied), the dmac transfers data according to the following procedure: 1. checks to see if transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0) 2. when a transfer request comes and transfer is enabled, the dmac transfers 1 transfer unit of data. (in auto-request mode, the transfer begins automatically when the de bit and dme bit are set to 1. the tcr value will be decremented by 1.) the actual transfer flows vary depending on the address mode and bus mode. 3. when the specified number of transfers have been completed (when tcr reaches 0), the transfer ends normally. if the ie bit in chcr is set to 1 at this time, a dei interrupt is sent to the cpu. 4. when an address error occurs in the dmac or an nmi interrupt is generated, the transfer is aborted. transfers are also aborted when the de bit in chcr or the dme bit in dmaor is changed to 0. figure 9.2 shows a flowchart illustrating this procedure. .com .com .com .com 4 .com u datasheet
246 tcr = 0? de, dme = 1 and nmif, ae, te = 0? has a transfer request been generated?* 1 transfer aborted initial settings (sar, dar, tcr, chcr, vcrdma, drcr, dmaor) transfer tcr-1 tcr, sar, and dar updated dei interrupt request (when ie = 1) te = 1 te = 1 no yes no yes no yes no yes no * 3 * 5 * 4 * 2 start end normally end transfer yes 16-byte transfer in progress? nmif = 1 or ae = 1, or de = 0, or dme = 0? nmif = 1, or ae = 1, or de = 0, or dme = 0? bus mode, transfer request mode, dreq detec- tion method? notes: 1. in auto-request mode, the transfer will start when the nmif, ae, and te bits are all 0 and the de and dme bits are then set to 1. 2. in burst mode, dreq = level detection (external request), or cycle-steal mode. 3. in burst mode, dreq = edge detection (external request), or auto-request mode in burst mode. 4. 16-byte transfer cycle in progress. 5. end of a 16-byte transfer cycle. figure 9.2 dma transfer flow .com .com .com .com 4 .com u datasheet
247 9.3.2 dma transfer requests dma transfer requests are usually generated in either the data transfer source or destination, but they can also be generated by devices that are neither the source nor the destination. transfers can be requested in three modes: auto-request, external request, and on-chip peripheral module request. the request mode is selected with the ar bit in dma channel control registers 0 and 1 (chcr0, chcr1) and the rs0 and rs1 bits in dma request/response selection control registers 0 and 1 (drcr0, drcr1). table 9.3 selecting the dma transfer request using the ar and rs bits chcr drcr ar rs1 rs0 request mode resource select 0 0 0 module request mode dreq external request (external request mode) 0 1 rxi (sci receive) request 1 0 txi (sci transmit) request 1 x x auto-request mode auto-request: when there is no transfer request signal from an external source (as in a memory- to-memory transfer or a transfer between memory and an on-chip peripheral module unable to request a transfer), the auto-request mode allows the dmac to automatically generate a transfer request signal internally. when the de bits in chcr0 and chcr1 and the dme bit in the dma operation register (dmaor) are set to 1, the transfer begins (so long as the te bits in chcr0 and chcr1 and the nmif and ae bits in dmaor are all 0). external request: in this mode a transfer is started by a transfer request signal (dreq) from an external device. choose one of the modes shown in table 9.4 according to the application system. when dma transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0), a transfer is performed upon input of a dreq signal. .com .com .com .com 4 .com u datasheet
248 table 9.4 selecting external request modes with the ta and am bits chcr transfer ta am address mode acknowledge mode source destination 0 0 dual address mode dack output in read cycle any* 1 any* 1 1 dual address mode dack output in write cycle any* 1 any* 1 1 0 single address mode data transferred from memory to device external memory *2 or memory-mapped external device external device with dack 1 single address mode data transferred from device to memory external device with dack external memory *2 or memory-mapped external device notes: 1. external memory, memory-mapped external device, on-chip peripheral module (excluding dmac, bsc, and ubc) 2. except synchronous dram choose to detect dreq either by the falling edge or by level using the ds and dl bits in chcr0 and chcr1 (ds = 0 is level detection, ds = 1 is edge detection; for edge detection, dl = 0 is rising edge, dl = 1 is falling edge; for level detection, dl = 0 is active-low, dl = 1 is active- high). the source of the transfer request does not have to be the data transfer source or destination. table 9.5 selecting the external request signal with the ds and dl bits drcr ds dl external request 0 0 level (active-low) 1 level (active-high) 1 0 edge (falling) 1 edge (rising) on-chip module request: in this mode, transfers are started by the transfer request signal (interrupt request signal) of an on-chip peripheral module in the sh7064. the transfer request signals are the receive-data-full interrupt (rxi) and transmit-data-empty interrupt (txi) of the serial communication interface (sci) (table 9.6). if dma transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0), dma transfer starts upon the input of a transfer request signal. .com .com .com .com 4 .com u datasheet
249 when rxi (transfer request when the sci? receive data buffer is full) is set as the transfer request, however, the transfer source must be the sci? receive data register (rdr). likewise, when txi (transfer request when the sci? transmit data buffer is empty) is set as the transfer request, the transfer destination must be the sci? transmit data register (tdr). table 9.6 selecting on-chip peripheral module request mode with the ar and rs bits ar rs1 rs0 dma transfer request source dma transfer request signal source destination bus mode dreq setting 001sci receiver rxi (sci receive- data-full transfer request) rdr any* cycle- steal edge, active-low 010sci transmitter txi (sci transmit- data-empty transfer request) any* tdr cycle- steal edge, active-low note: external memory, memory-mapped external device, on-chip peripheral module (excluding dmac, bsc, and ubc) when outputting transfer requests from the sci, its interrupt enable bits (tie and rie in scr) must be set to output the interrupt signals. note that transfer request signals from on-chip peripheral modules (interrupt request signals) are sent not just to the dmac but to the cpu as well. when an on-chip peripheral module is specified as the transfer request source, set the priority level values in the interrupt priority level registers (iprc?pre) of the interrupt controller (intc) at or below the levels set in the i3?0 bits of the cpu? status register so that the cpu does not accept the interrupt request signal. the dma transfer request signals shown in table 9.6 are automatically fetched when the corresponding dma transfer is performed. if cycle-steal mode is used, a dma transfer request (interrupt request) from any module will be cleared at the first transfer; if burst mode is used, it will be cleared at the last transfer. 9.3.3 channel priorities when the dmac receives simultaneous transfer requests on two channels, it selects a channel according to a predetermined priority order. there are two priority modes, fixed and round-robin. the channel priority is selected by the priority bit, pr, in the dma operation register (dmaor). fixed priority mode: in this mode, the relative channel priority levels are fixed. when pr is set to 0, the priority, high to low, is channel 0 > channel 1. figure 9.3 shows an example of a transfer in burst mode. .com .com .com .com 4 .com u datasheet
250 cpu bus cycle dreq1 dreq0 cpu cpu channel 0 source channel 0 destination channel 0 source channel 0 destination channel 1 source channel 1 destination figure 9.3 fixed mode burst dma transfer (dual address, active-low dreq level) in cycle-steal mode, once a channel 0 request is accepted, channel 1 requests are also accepted until the next request is made, which makes more effective use of the bus cycle. when requests come simultaneously for channel 0 and channel 1 when dma operation is starting, the first is transmitted multiplexed with channel 0 and thereafter channel 1 and channel 0 transfers are performed alternately. cpu bus cycle dreq1 dreq0 cpu cpu cpu cpu channel 0 source channel 1 source channel 0 source channel 0 destination channel 1 destination figure 9.4 fixed mode cycle-steal dma transfer (dual address, active-low dreq level) round-robin mode: switches the priority of channel 0 and channel 1, shifting their ability to receive transfer requests. each time one transfer ends on one channel, the priority shifts to the other channel. the channel on which the transfer just finished is assigned low priority. after reset, channel 0 has higher priority than channel 1. figure 9.5 shows how the priority changes when channel 0 and channel 1 transfers are requested simultaneously and another channel 0 transfer is requested after the first two transfers end. the dmac operates as follows: 1. transfer requests are generated simultaneously to channels 1 and 0. 2. channel 1 has the higher priority, so the channel 1 transfer begins first (channel 0 waits for transfer). 3. when the channel 1 transfer ends, channel 1 becomes the lower-priority channel. .com .com .com .com 4 .com u datasheet
251 4. the channel 0 transfer begins. 5. when the channel 0 transfer ends, channel 0 becomes the lower-priority channel. 6. a channel 0 transfer is requested. 7. the channel 0 transfer begins. 8. when the channel 0 transfer ends, channel 0 is already the lower-priority channel, so the order remains the same. 0 none none 1. requests occur in channels 0 and 1 6. request occurs in channel 0 2. channel 1 transfer starts 3. channel 1 transfer ends 5. channel 0 transfer ends 7. channel 0 transfer starts 4. channel 0 transfer starts 8. channel 0 transfer ends priority changes 1 > 0 0 > 1 1 > 0 1 > 0 transfer requests waiting channel dmac operation channel priority order priority changes priority does not change waiting for transfer request figure 9.5 channel priority in round-robin mode 9.3.4 dma transfer types the dmac supports all the transfers shown in table 9.7. it can operate in single address mode or dual address mode, as defined by how many bus cycles the dmac takes to access the transfer source and transfer destination. the actual transfer operation timing varies with the dmac bus mode used: cycle-steal mode or burst mode. .com .com .com .com 4 .com u datasheet
252 table 9.7 supported dma transfers destination source external device with dack external memory memory-mapped external device on-chip peripheral module external device with dack not available single single not available external memory single dual dual dual memory-mapped external device single dual dual dual on-chip peripheral module not available dual dual dual* single: single address mode dual: dual address mode note: access size enabled by the register of the on-chip peripheral module that is the source or destination (excludes dmac, bsc, and ubc). address modes: ? single address mode in single address mode, both the transfer source and destination are external; one (selectable) is accessed by a dack signal while the other is accessed by address. in this mode, the dmac performs the dma transfer in one bus cycle by simultaneously outputting a transfer request acknowledge dack signal to one external device to access it while outputting an address to the other end of the transfer. figure 9.6 shows an example of a transfer between external memory and external device with dack. the external device outputs data to the data bus while that data is written in external memory in the same bus cycle. dmac dack dreq external memory external device with dack sh7604 external address bus : data flow external data bus figure 9.6 data flow in single address mode .com .com .com .com 4 .com u datasheet
253 two types of transfers are possible in single address mode: 1) transfers between external devices with dack and memory-mapped external devices; and 2) transfers between external devices with dack and external memory. transfer requests for both of these must be by means of the external request signal (dreq). figure 9.7 shows the dma transfer timing for single address mode. ck a26 a0 cs we d30 d0 dack bs address output to external memory space write strobe signal to external memory space data output from external device with dack dack signal (active low) to external device with dack a. external device with dack to external memory space ck a26 a0 cs rd d30 d0 dack address output to external memory space data output from external memory space read strobe signal to external memory space dack signal (active low) to external device with dack bs b. external memory space to external device with dack figure 9.7 dma transfer timing in single address mode .com .com .com .com 4 .com u datasheet
254 ? dual address mode in dual address mode, both the transfer source and destination are accessed (selectable) by address. the source and destination can be located externally or internally. the dmac accesses the source in the read cycle and the destination in the write cycle, so the transfer is performed in two separate bus cycles. the transfer data is temporarily stored in the dmac. figure 9.8 shows an example of a transfer between two external memories in which data is read from one memory in the read cycle and written to the other memory in the following write cycle. dmac external memory external memory sh7604 2 1 external data bus : data flow 1: read cycle 2: write cycle figure 9.8 data flow in dual address mode in dual address mode transfers, external memory, memory-mapped external devices and on- chip peripheral modules can be mixed without restriction. specifically, this enables transfers between the following: 1. external memory and external memory. 2. external memory and memory-mapped external devices. 3. memory-mapped external devices and memory-mapped external devices. 4. external memory and on-chip peripheral modules (excluding the dmac, bsc, and ubc). 5. memory-mapped external devices and on-chip peripheral modules (excluding the dmac, bsc, and ubc). the access size is that is enabled by the register of the on-chip peripheral module that is the source or destination (excludes the dmac, bsc, and ubc). 6. on-chip peripheral modules (excluding the dmac, bsc, and ubc) and on-chip peripheral modules (excluding the dmac, bsc, and ubc). .com .com .com .com 4 .com u datasheet
255 transfer requests can be auto-requests, external requests, or on-chip peripheral module requests. when the transfer request source is the sci, however, either the data destination or source must be the sci (see table 9.6). dual address mode outputs dack in either the read cycle or write cycle. chcr controls the cycle in which dack is output. figure 9.9 shows the dma transfer timing in dual address mode. ck a26 a0 d31 d0 cs rd dack bs we address output to external memory space read strobe signal to external memory space write strobe signal to external memory space i/o data of external memory space dmac acknowledge signal (active-low) figure 9.9 dma transfer timing in dual address mode (external memory space external memory space, dack output in read cycle) bus modes: there are two bus modes: cycle-steal and burst. select the mode with the tb bits in chcr0 and chcr1. ? cycle-steal mode in cycle-steal mode, the bus right is given to another bus master after the dmac transfers one transfer unit (byte, word, longword, or 16 bytes). when another transfer request occurs, the bus right is retrieved from the other bus master and another transfer is performed for one transfer unit. when that transfer ends, the bus right is passed to the other bus master. this is repeated until the transfer end conditions are satisfied. cycle-steal mode can be used with all categories of transfer destination, transfer source, and transfer request source. the cpu may take the bus twice when an acknowledge signal is output during the write cycle or in single address mode. figure 9.10 shows an example of dma transfer timing in cycle-steal mode (dual address mode, dreq level detection). .com .com .com .com 4 .com u datasheet
256 cpu cpu cpu dmac dmac cpu dmac dmac cpu dreq bus cycle bus right returned to cpu read write read write figure 9.10 dma transfer timing in cycle-steal mode (dual address mode, dreq level detection) ? burst mode in burst mode, once the dmac gets the bus, the transfer continues until the transfer end condition is satisfied. when external request mode is used with level detection of the dreq pin, however, negating dreq will pass the bus to the other bus master after completion of the bus cycle of the dmac that currently has an acknowledged request, even if the transfer end conditions have not been satisfied. burst mode cannot be used when the transfer request originates from the serial communication interface (sci). figure 9.11 shows an example of dma transfer timing in burst mode (single address mode, dreq level detection). cpu cpu cpu dmac dmac dmac dmac dmac dreq bus cycle dmac cpu figure 9.11 dma transfer timing in burst mode (single address mode, dreq level detection) refreshes cannot be performed during a burst transfer, so ensure that the number of transfers satisfies the refresh request period when a memory requiring refreshing is used. relationship of request modes and bus modes by dma transfer category: table 9.8 shows the relationship between request modes, bus modes, etc., by dma transfer category. .com .com .com .com 4 .com u datasheet
257 table 9.8 relationship of request modes and bus modes by dma transfer category address mode transfer category request mode bus mode transfer size (bytes) single external device with dack and external memory external b/c 1/2/4 external device with dack and memory-mapped external device external b/c 1/2/4 dual external memory and external memory all *1 b/c 1/2/4/16 external memory and memory-mapped external device all *1 b/c 1/2/4/16 memory-mapped external device and memory- mapped external device all *1 b/c 1/2/4/16 external memory and on-chip peripheral module all *2 b/c *3 1/2/4/16 *4 memory-mapped external device and on-chip peripheral module all *2 b/c *3 1/2/4/16 *4 on-chip peripheral module and on-chip peripheral module all *2 b/c *3 1/2/4/16 *4 b: burst, c: cycle-steal notes: 1. external requests and auto-requests are both available. the sci cannot be specified as the transfer request source, however, except for on-chip peripheral module requests. 2. external requests, auto-requests and on-chip peripheral module requests are all available. when the sci is the transfer request source, however, the transfer destination or transfer source must be the sci. 3. if the transfer request source is the sci, cycle-steal (c) only (dreq by edge detection, active low). 4. the access size is that permitted by the register of the on-chip peripheral module that is the transfer destination or source. bus mode and channel priority: when a given channel (1) is transferring in burst mode and there is a transfer request to a channel (0) with a higher priority, the transfer of the channel with higher priority (0) will begin immediately. when channel 0 is also operating in the burst mode, the channel 1 transfer will continue as soon as the channel 0 transfer has completely finished. when channel 0 is in cycle-steal mode, channel 1 will begin operating again after channel 0 completes the transfer of one transfer unit, but the bus will then switch between the two in the order channel 1, channel 0, channel 1, channel 0. since channel 1 is in burst mode, it will not give the bus to the cpu. this example is illustrated in figure 9.12. .com .com .com .com 4 .com u datasheet
258 cpu bus state dmac ch1 dmac ch1 dmac ch0 dmac ch1 dmac ch0 dmac ch1 dmac ch1 cpu ch0 ch1 ch0 dmac ch1 and ch0 cycle-steal dmac ch1 burst mode cpu cpu dmac ch1 burst mode note: priority is ch0 > ch1, ch1 is in burst mode, ch0 is in cycle-steal mode figure 9.12 bus status when multiple channels are operating 9.3.5 number of bus cycles the number of states in the bus cycle when the dmac is the bus master is controlled by the bus control register (bcr1) and wait state control register (wcr) of the bus state controller just as it is when the cpu is the bus master. 9.3.6 dma transfer request acknowledge signal output timing dma transfer request acknowledge signal dackn is output synchronous to the dmac address output specified by the channel control register am bit of the address bus. the timing is normally to have the acknowledge signal become valid when the dma address output begins and become invalid 0.5 cycles before the address output ends. (see figure 9.11.) the output timing of the acknowledge signal varies with the settings of the connected memory space. the output timing of acknowledge signals in the memory spaces is shown in figure 9.13. clock dack address bus cpu dmac 0.5 cycles figure 9.13 example of dack output timing .com .com .com .com 4 .com u datasheet
259 acknowledge signal output when external memory is set as ordinary memory space: the timing at which the acknowledge signal is output is the same in the dma read and write cycles specified by the am bit (figures 9.14 and 9.15). when dma address output begins, the acknowledge signal becomes valid; 0.5 cycles before address output ends, it becomes invalid. if a wait is inserted in this period and address output is extended, the acknowledge signal is also extended. clock dack address bus cpu dmac read dmac write invalid write cpu 0.5 cycles dmac read t 1 t w t 2 basic timing 1 wait inserted figure 9.14 dack output in ordinary space accesses (am = 0) clock dack address bus dmac read dmac write invalid write invalid write cpu dmac read basic timing 1 wait inserted dmac write figure 9.15 dack output in ordinary space accesses (am = 1) in a longword access of a 16-bit external device (figure 9.16) or an 8-bit external device (figure 9.17), or a word access of an 8-bit external device (figure 9.18), the lower and upper addresses are output 2 and 4 times in each dmac access in order to align the data. for all of these addresses, the acknowledge signal becomes valid simultaneous with the start of output and becomes invalid 0.5 cycles before the address output ends. when multiple addresses are output in a single access to align data for synchronous dram, dram, pseudo-sram, or burst rom, an acknowledge signal is output to those addresses as well. .com .com .com .com 4 .com u datasheet
260 clock dack address bus cpu h dmac read h dmac read l invalid write dmac write basic timin g *1 *2 notes: 1. l: lsb side 2. h: msb side figure 9.16 dack output in ordinary space accesses (am = 0, longword access to 16-bit external device) clock dack address bus cpu h dmac read hh dmac read hl dmac read lh dmac read ll basic timin g figure 9.17 dack output in ordinary space accesses (am = 0, longword access to 8-bit external device) clock dack address bus cpu h dmac read h dmac read l invalid write dmac write basic timing figure 9.18 dack output in ordinary space accesses (am = 0, word access to 8-bit external device) .com .com .com .com 4 .com u datasheet
261 acknowledge signal output when external memory is set as synchronous dram: when external memory is set as synchronous dram auto-precharge and am = 0, the acknowledge signal is output across the row address, read command, wait and read address of the dmac read (figure 9.19). since the synchronous dram read has only burst mode, during a single read an invalid address is output; the acknowledge signal, however, is output on the same timing (figure 9.20). at this time, the acknowledge signal is extended until the write address is output after the invalid read. when am = 1, the acknowledge signal is output across the row address and column address of the dmac write (figure 9.21). clock dack address bus cpu dmac read (basic timin g ) row address read 1 read 2 read 3 read 4 read command figure 9.19 dack output in synchronous dram burst read (auto-precharge, am = 0) clock dack address bus cpu invalid read dmac read (basic timing) dmac write (basic timing) row address column address row address read read command figure 9.20 dack output in synchronous dram single read (auto-precharge, am = 0) .com .com .com .com 4 .com u datasheet
262 clock dack address bus dmac write ( basic timin g) column address row address figure 9.21 dack output in synchronous dram write (auto-precharge, am = 1) when external memory is set as bank active synchronous dram, during a burst read the acknowledge signal is output across the read command, wait and read address when the row address is the same as the previous address output (figure 9.22). when the row address is different from the previous address, the acknowledge signal is output across the precharge, row address, read command, wait and read address (figure 9.23). clock dack address bus cpu dmac read (basic timing) read command read 1 read 2 read 3 read 4 figure 9.22 dack output in synchronous dram burst read (bank active, same row address, am = 0) .com .com .com .com 4 .com u datasheet
263 clock dack address bus cpu dmac read (basic timing) pre- charge read command read 1 read 2 read 3 read 4 row address figure 9.23 dack output in synchronous dram burst read (bank active, different row address, am = 0) when external memory is set as bank active synchronous dram, during a single read the acknowledge signal is output across the read command, wait and read address when the row address is the same as the previous address output (figure 9.24). when the row address is different from the previous address, the acknowledge signal is output across the precharge, row address, read command, wait and read address (figure 9.25). since the synchronous dram read has only burst mode, during a single read an invalid address is output; the acknowledge signal is output on the same timing. at this time, the acknowledge signal is extended until the write address is output after the invalid read. clock dack address bus cpu read invalid read dmac read (basic timing) dmac write (basic timing) read command row address column address figure 9.24 dack output in synchronous dram single read (bank active, same row address, am = 0) .com .com .com .com 4 .com u datasheet
264 clock dack address bus cpu invalid read dmac read (basic timing) dmac write (basic timing) row address read command row address column address pre- charge read figure 9.25 dack output in synchronous dram single read (bank active, different row address, am = 0) when external memory is set as bank active synchronous dram, during a write the acknowledge signal is output across the wait and column address when the row address is the same as the previous address output (figure 9.26). when the row address is different from the previous address, the acknowledge signal is output across the precharge, row address, wait and column address (figure 9.27). clock dack address bus dmac write (basic timing) column address figure 9.26 dack output in synchronous dram write (bank active, same row address, am = 1) .com .com .com .com 4 .com u datasheet
265 clock dack address bus dmac write (basic timing) precharge row address column address figure 9.27 dack output in synchronous dram write (bank active, different row address, am = 1) acknowledge signal output when external memory is set as dram: when external memory is set as dram and a row address is output during a read or write, the acknowledge signal is output across the row address and column address (figures 9.28?.30). clock dack address bus dmac read or write ( basic timin g) precharge row address column address figure 9.28 dack output in normal dram accesses (am = 1 or 0) .com .com .com .com 4 .com u datasheet
266 clock dack address bus dmac read or write (basic timin g ) column address figure 9.29 dack output in dram burst accesses (same row address, am = 1 or 0) clock dack address bus dmac read or write (basic timing) pre- charge row address column address figure 9.30 dack output in dram burst accesses (different row address, am = 1 or 0) acknowledge signal output when external memory is set as pseudo-sram: when external memory is set as pseudo-sram , the acknowledge signal is output synchronous to the dmac address for both reads and writes (figures 9.31?.33). .com .com .com .com 4 .com u datasheet
267 clock dack address bus dmac read or write (basic timing) pre- charge dmac address figure 9.31 dack output in normal pseudo-sram accesses (am = 1 or 0) clock dack address bus dmac read or write (basic timing) dmac address figure 9.32 dack output in pseudo-sram burst accesses (same row address, am = 1 or 0) clock dack address bus dmac read or write (basic timing) dmac address pre- charge figure 9.33 dack output in pseudo-sram burst accesses (different row address, am = 1 or 0) .com .com .com .com 4 .com u datasheet
268 acknowledge signal output when external memory is set as burst rom: when external memory is set as burst rom, the acknowledge signal is output synchronous to the dmac address (no dual writes allowed) (figure 9.34). clock dack address bus dmac (1 wait state) dmac cycle dmac cycle figure 9.34 dack output in nibble accesses of burst rom 9.3.7 dreq pin input detection timing in external request mode, dreq pin signals are usually detected at the rising edge of the clock pulse (ckio). when a request is detected, a dmac bus cycle is produced three cycles later at the earliest and a dma transfer performed. after the request is detected, the timing of the next input detection varies with the bus mode, address mode, method of dreq input detection, and the memory connected. dreq pin input detection timing in cycle-steal mode: in cycle-steal mode, once a request is detected from the dreq pin, request detection for the next dma transfer cannot be performed for a certain period of time. after request detection has again become possible, detectable cycles continue until a request is detected. figure 9.35 illustrates the timing from the detection of a request till the next time requests are detectable. ? cycle-steal mode edge detection requests can be detected 2 cycles after dack output. after that point, the request is input to dreq. (if input prior to that point, a request may or may not be detected, depending on the internal state.) .com .com .com .com 4 .com u datasheet
269 transfer width: byte, word, longword transfer bus mode: cycle-steal mode transfer address modes: dual and single modes dreq detection method: edge detection dack output timing: read, write (dual), dmac cycle (single) bus cycle: basic bus cycle cpu clock dreq dack 1st acceptance * 1 * 1 2 cycles bus cycle cpu * 2 dmac 2nd acceptance notes: 1. request detection 2. when dack is output in a write (dual), the cycle is a dmac read. otherwise, the cycle is a cpu cycle. figure 9.35 dreq pin input detection timing in cycle-steal mode with edge detection (1) figures 9.36 and 9.37 show examples of how to change the bus width of an external device. .com .com .com .com 4 .com u datasheet
270 cpu clock dreq dack * 1 * 1 bus cycle cpu * 2 dmac h dmac l 1st acceptance 2 cycles 2nd acceptance notes: 1. request detection 2. when dack is output in a write (dual), the cycle is a dmac read. otherwise, the cycle is a cpu cycle. figure 9.36 changing the bus size of a 16-bit external device cpu dreq dack cpu * 2 dmac hh dmac hl dmac lh dmac ll clock * 1 * 1 bus cycle 2 cycles 2nd acceptance 1st acceptance notes: 1. request detection 2. when dack is output in a write (dual), the cycle is a dmac read. otherwise, the cycle is a cpu cycle. figure 9.37 changing the bus size of an 8-bit external device .com .com .com .com 4 .com u datasheet
271 transfer width: 16-byte transfer bus mode: cycle-steal mode transfer address mode: dual mode dreq detection method: edge detection dack output timing: dmac read and write cycles bus cycle: basic bus cycle cpu * 2 dmac 1 dmac 2 dmac 3 dmac 4 dreq dack clock * 1 * 1 bus cycle 2 cycles 2nd acceptance 1st acceptance * 3 * 3 * 3 * 3 notes 1. request detection 2. when a write (dual) occurs at dack output, the cycle is a dmac read. otherwise, the cycle is a cpu cycle. 3. when dack is output in a write (dual), the cycle is a dmac write; when in a read (dual), the cycle is a dmac read. figure 9.38 dreq pin input detection timing in cycle-steal mode with edge detection (2) requests can be detected 2 cycles after dack output. after that point, the request is input to dreq. (if input prior to that point, a request may or may not be detected, depending on the internal state.) dack is output synchronous to all 4 transfers (figure 9.38). .com .com .com .com 4 .com u datasheet
272 transfer width: byte, word, longword transfer bus mode: cycle-steal mode transfer address modes: dual and single modes dreq detection method: level detection dack output timing: read (dual), dmac cycle (single) bus cycle: basic bus cycle cpu dreq dack cpu dmac read * 2 clock * 1 bus cycle 3 cycles 2 cycles area where 2nd acceptance is possible 1st acceptance notes: 1. request detection 2. request detection not established. figure 9.39 timing of dreq pin input detection in cycle-steal mode with level detection (1) ? cycle-steal mode level detection requests can be detected for the first time 3 cycles after the bus cycle prior to the dmac read cycle and detection starts sometime between then and 2 cycles after dack output (figure 9.40, 41). this varies with variations in waits and the like. this means that if request output is stopped within 3 cycles from the bus cycle prior to the dmac read cycle, the next dma transfer is not performed; if request output is stopped within 2 cycles of dack output, the next dma transfer may sometimes be performed. see examples of handling of request signal acceptance later in this section (9.3.7). .com .com .com .com 4 .com u datasheet
273 cpu dreq dack cpu h cpu l dmac h dmac l * 2 clock * 1 bus cycle 3 cycles 2 cycles area where 2nd acceptance is possible 1st acceptance notes: 1. request detection 2. request detection not established. figure 9.40 changing the bus size of a 16-bit external device cpu hh cpu hl cpu lh cpu ll dmac hh dmac hl dmac lh dmac ll dreq dack * 2 clock * 1 bus cycle 3 cycles 2 cycles area where 2nd acceptance is possible 1st acceptance notes: 1. request detection 2. request detection not established. figure 9.41 changing the bus size of an 8-bit external device .com .com .com .com 4 .com u datasheet
274 transfer width: byte, word, longword transfer bus mode: cycle-steal mode transfer address mode: dual mode dreq detection method: level detection dack output timing: dmac write cycle bus cycle: basic bus cycle dreq dack cpu cpu dmac read dmac write cpu clock ** bus cycle 2 cycles 1st acceptance 2nd acceptance cpu invalid write note: request detection figure 9.42 timing of dreq pin input detection in cycle steal mode with level detection (2) the next request can be detected 2 cycles after dack output (figure 9.42). .com .com .com .com 4 .com u datasheet
275 transfer width: 16-byte transfer bus mode: cycle-steal mode transfer address mode: dual mode dreq detection method: level detection dack output timing: dmac write cycle bus cycle: basic bus cycle cpu dmac read 1 dmac read 2 dmac read 3 dmac read 4 dmac write 1 dmac write 2 dmac write 3 dmac write 4 dreq dack *2 clock *1 bus cycle 3 cycles 2 cycles 2nd acceptance 1st acceptance invalid write cpu notes: 1. request detection 2. request detection not established. figure 9.43 timing of dreq pin input detection in cycle steal mode with level detection (3) requests can be detected for the first time 3 cycles after the bus cycle prior to the dmac read cycle and starts sometime between then and 2 cycles after dack output (figure 9.43). this varies with variations in waits and the like. this means that if request output is stopped within 3 cycles from the bus cycle prior to the dmac read cycle, the next dma transfer is not performed; if request output is stopped within 2 cycles of dack output, the next dma transfer may sometimes be performed. .com .com .com .com 4 .com u datasheet
276 transfer width: 16-byte transfer bus mode: cycle-steal mode transfer address mode: dual mode dreq detection method: level detection dack output timing: dmac write cycle bus cycle: basic bus cycle dmac read 4 cpu cpu dreq dack a1 a2 a3 a4 b1 b2 b3 b4 clock bus cycle 2 cycles 1st acceptance *** * 2 cycles 2 cycles 4th acceptance 2nd acceptance 3rd acceptance 2nd 16-byte transfer 1st 16-byte transfer invalid write dmac read 1 dmac write 1 dmac write 2 dmac write 3 cpu dmac write 4 dmac read 1 invalid write dmac write 1 dmac write 2 dmac write 3 dmac write 4 cpu cpu dmac read 4 note: request detection figure 9.44 timing of dreq pin input detection in cycle steal mode with level detection (4) for 16-byte transfers, dack signals are output at all consecutive writes (figure 9.44). the acknowledge signals are a1, a2, a3, a4, b1, b2, b3, b4, ? the second transfer request can be detected 2 cycles after output of acknowledge signal a1. the third transfer request is detected at a3, that is, 2 cycles after output of the third acknowledge signal of the first transfer. the fourth transfer request is detected 2 cycles after output of b3. requests thereafter are detected 2 cycles after the third acknowledge signal of each transfer, as with the fourth transfer. note: when transferring alternately on channels 0 and 1 by round robin or the like, the next request signal is detected only 2 cycles after the first acknowledge signal of each transfer (figure 9.45). .com .com .com .com 4 .com u datasheet
277 b4 cpu b3 b2 b1 2 cycles 2 cycles dmac read 1 a4 cpu cpu bus cycle dack1 dack0 dreq1 dreq0 ck dmac read 4 a3 a2 a1 ** b4 b3 b2 b1 2 cycles c4 c3 c2 c1 2 cycles a4 a3 a2 a1 2 cycles * * 1st acceptance 2nd acceptance 3rd acceptance 1st acceptance 1st 0 ch 16-byte transfer 2nd 0 ch 16-byte transfer cpu dmac write 1 dmac write 2 dmac write 3 dmac write 4 dmac read 1 dmac read 4 invalid write dmac write 1 dmac write 2 dmac write 3 dmac write 4 * * * 3rd acceptance 4th acceptance 2nd acceptance 1st 1 ch 16-byte transfer 3rd 0 ch 16-byte transfer 2nd 1 ch 16-byte transfer dmac read 1 dmac read 4 dmac write 1 invalid write invalid write dmac write 2 dmac write 3 dmac write 4 cpu dmac read 1 dmac read 4 invalid write dmac write 1 dmac write 3 cpu dmac write 2 dmac write 4 dmac read 1 dmac read 4 invalid write dmac write 1 dmac write 3 dmac write 2 dmac write 4 2 3 1 4 5 6 2 3 1 4 5 6 transfer width: 16-byte transfer bus mode: cycle-steal mode transfer address mode: dual mode priority mode: round robin mode note: request detection timing dreq detection method: level detection dack output timing: dmac write cycle bus cycle: basic bus cycle figure 9.45 example of simultaneous operation of 2 channels .com .com .com .com 4 .com u datasheet
278 dreq pin input detection timing in burst mode: in burst mode, the request detection timing differs when dreq input is detected by edge and when detected by level. when dreq input is detected by edge, once a request is detected, dma transfers continue until the conditions for ending the transfers are met, regardless of the state of the dreq pin thereafter. during this period, requests cannot be detected. when the transfer start conditions are met after a transfer ends, requests can be detected again for each cycle. when dreq input is detected by level, whenever a request is detected for the same channel as in the next request detection cycle, that channel is executed continuously. when no request is input, however, the bus cycles of other channels and other bus masters are executed. ? burst mode, single mode, level detection acknowledge signals for request signals are output 3 cycles later at the earliest. even when the request signal is dropped within 2 cycles of the output of this acknowledge signal, the fourth or fifth requests in figure 9.46 are accepted. this means that 4 or 5 dma transfers are executed even when the request for the 1st acknowledge signal drops out. transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: single mode dreq detection method: level detection dack output timing: dmac cycle bus cycle: basic bus cycle dreq dack dmac read 1 clock bus cycle * 1st accept- ance 3rd accept- ance 4th accept- ance 2nd accept- ance ** * * 5th accept- ance 6th accept- ance dmac read 2 dmac read 3 dmac read 4 dmac read 5 dmac read 6 * note: request detection (the points when the acceptances occur vary with the type of wait.) figure 9.46 timing of dreq pin input detection in burst mode with level detection (1) (data transfer from normal space to device) .com .com .com .com 4 .com u datasheet
279 acknowledge signals for request signals are output 4 cycles later, at the soonest. even when the request signal is dropped within 0.5 cycle of the output of this acknowledge signal, the third request in figure 9.46 is accepted. this means that the 3rd dma transfer is executed even when the request for the 1st acknowledge signal drops out. the detection timing for the 4th and subsequent requests is as shown in figure 9.46. transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: single mode dreq detection method: level detection dack output timing: dmac cycle bus cycle: basic bus cycle dreq dack clock bus cycle ** * 1st accept- ance 3rd accept- ance 4th accept- ance 2nd accept- ance 5th accept- ance 6th accept- ance dmac write 1 dmac write 2 dmac write 3 dmac write 4 dmac write 5 dmac write 6 invalid write *** note: request detection (the points when the acceptances occur vary with the type of wait.) figure 9.47 timing of dreq pin input detection in burst mode with level detection (2) (data transfer from device to normal space) acknowledge signals for request signals are output 4 cycles later at the earliest. even when the request signal is dropped within 0.5 cycle of the output of this acknowledge signal, the third request in figure 9.47 is accepted. this means that the 3rd dma transfer is executed even when the request for the first acknowledge signal drops out. the detection timing for the 4th and subsequent requests is a shown in figure 9.47. note on evaluation chip: the request signal detection timing in the evaluation chip differs from that in the user chip. the evaluation chip detection timing corresponding to figures 9.46 and 9.47 is shown in figures 9.48 and 9.49. .com .com .com .com 4 .com u datasheet
280 transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: single mode dreq detection method: level detection dack output timing: dmac cycle bus cycle: basic bus cycle * clock bus cycle dreq dack 1st accept- ance 3rd accept- ance 4th accept- ance 2nd accept- ance 5th accept- ance 6th accept- ance dmac read 1 dmac read 2 dmac read 3 dmac read 4 dmac read 5 dmac read 6 ***** note: request detection (the points when the acceptances occur vary with the type of wait.) figure 9.48 timing of dreq pin input detection in burst mode with level detection (3) (data transfer from normal space to device, using evaluation chip) transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: single mode dreq detection method: level detection dack output timing: dmac cycle bus cycle: basic bus cycle clock dreq bus cycle dack *** * * * 1st accept- ance 2nd accept- ance 3rd accept- ance 4th accept- ance 5th accept- ance 6th accept- ance invalid write invalid write dmac write 1 dmac write 2 dmac write 3 dmac write 4 dmac write 5 invalid write invalid write invalid write note: request detection (the points when the acceptances occur vary with the type of wait.) figure 9.49 timing of dreq pin input detection in burst mode with level detection (4) (data transfer from device to normal memory, using evaluation chip) .com .com .com .com 4 .com u datasheet
281 ? burst mode, dual mode, level detection transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: single mode dreq detection method: level detection dack output timing: dmac read bus cycle: basic bus cycle cpu dmac read dmac read dmac invalid write clock dreq dack 1st acceptance * 2nd acceptance 3rd acceptance * * bus cycle note: request detection (the points when the 1st and 2nd acceptances occur vary with the type of wait.) figure 9.50 timing of dreq pin input detection in burst mode with level detection (5) acknowledge signals for request signals are output 4 cycles later, at the soonest. even when the request signal is dropped within 0.5 cycle of the output of the acknowledge signal, the 2nd request in figure 9.50 is accepted. this means that two dma transfers are executed even when the request for the 1st acknowledge signal drops out. .com .com .com .com 4 .com u datasheet
282 transfer width: byte, word, longword transfer bus mode: burst mode transfer address mode: dual mode dreq detection method: level detection dack output timing: dmac write bus cycle: basic bus cycle cpu dmac read dmac write dmac invalid write clock dreq dack bus cycle 1st acceptance * 2nd acceptance 3rd acceptance ** note: request detection (the points when the 1st and 2nd acceptances occur vary with the type of wait.) figure 9.51 timing of dreq pin input detection in burst mode with level detection (6) acknowledge signals for request signals are output 6 cycles later, at the soonest. even when the request signal is dropped within 0.5 cycle of the output of the acknowledge signal, the 2nd request in figure 9.51 is accepted. this means that two dma transfers are executed even when the request for the 1st acknowledge signal drops out. examples of handling of request signal acceptance: when dreq level acceptance is used in the cycle-steal mode, the following methods can be used when the request signal is received: 1. control the number of transfers by tcr 2. use edge for request acceptance 3. perform acknowledge signal output at the dmac write timing additional cautions when emulators are used: when dreq level acceptance is by an emulator in cycle-steal mode, the timing of request signal acceptance is 2 cycles after the output of the acknowledge signal, so it differs from ordinary specifications. this means that when dmac operation is emulated, the timing is somewhat different, which may have other ramifications. .com .com .com .com 4 .com u datasheet
283 9.3.8 dma transfer end the dma transfer ending conditions vary when channels end individually and when both channels end together. conditions for channels ending individually: when either of the following conditions are met, the transfer will end in the relevant channel only: ? the value of the channel? dma transfer count register (tcr) becomes 0. when the tcr value becomes 0, the dma transfer for that channel ends and the transfer-end flag bit (te) is set in chcr. if the ie (interrupt enable) bit has already been set, a dmac interrupt (dei) request is sent to the cpu. in 16-byte transfer, when the tcr is 3,2,1 during the final transfer, the source address will be output four times, but the destination address will only be output the number of times found in tcr before transfer ends. ? the de bit of the dma channel control register (chcr) is cleared to 0. when the dma enable bit (de) in chcr is cleared, dma transfers in the affected channel are halted. the te bit is not set when this happens. source address first time source address second time source address third time source address fourth time destination address first time destination address second time cpu tcr = 0 (transfer ends normally) figure 9.52 16-byte transfer when tcr = 2 conditions for both channels ending simultaneously: transfers on both channels end when either of the following conditions is met: ? the nmif (nmi flag) bit or ae (address error flag) bit is set to 1 in dmaor. when an nmi interrupt or dmac address error occurs and the nmif or ae bit is set to 1 in dmaor, all channels stop their transfers. the dma source address register (sar), designation address register (dar), and transfer count register (tcr) are all updated by the transfer immediately preceding the halt. when this transfer is the final transfer, te = 1 and the transfer ends. to resume transfer after nmi interrupt exception handling or address error exception handling, clear the appropriate flag bit. when the de bit is then set to 1, the transfer on that channel will restart. to avoid this, keep its de bit at 0. in dual address mode, dma transfer will be halted after the completion of the following write cycle even when the address error occurs in the initial read cycle. sar, dar and tcr are updated by the final transfer. .com .com .com .com 4 .com u datasheet
284 ? the dma master enable (dme) bit in dmaor is cleared to 0. clearing the dme bit in dmaor forcibly aborts the transfers on both channels at the end of the current bus cycle. when the transfer is the final transfer, te = 1 and the transfer ends. 9.4 examples of use 9.4.1 dma transfer between on-chip sci and external memory in the following example, data received on the on-chip serial communication interface (sci) is transferred to external memory using dmac channel 1. table 9.9 shows the transfer conditions and register settings. table 9.9 register settings for transfers between on-chip sci and external memory transfer conditions register setting transfer source: rdr of on-chip sci sar1 h'fffffe05 transfer destination: external memory (word space) dar1 destination address number of transfers: 64 tcr1 h'0040 transfer destination address: incremented chcr1 h'4045 transfer source address: fixed bus mode: cycle-steal transfer unit: byte dei interrupt request generated at end of transfer (de = 1) channel priority: fixed (0 > 1) (dme = 1) dmaor h'0001 transfer request source (transfer request signal): sci (rxi) drcr1 h'01 note: check the cpu interrupt level when interrupts are enabled in the sci. .com .com .com .com 4 .com u datasheet
285 9.5 usage notes 1. dma request/response selection control registers 0 and 1 (drcr0 and drcr1) should be accessed in bytes. all other registers should be accessed in longword units. 2. before rewriting chcr0, chcr1, drcr0, and drcr1, first clear the de bit for the specified channel to 0 or clear the dme bit in dmaor to 0. 3. when the dmac is not operating, the nmif bit in dmaor is set even when an nmi interrupt is input. 4. when the cache is used as on-chip ram, the dmac cannot access this ram. 5. set to standby mode after the dme bit in dmaor is set to 0. 6. do not access the dmac, bsc, and ubc on-chip peripheral modules. 7. do not access the cache (address array, data array, associative purge area). 8. to detect the dreq pin signal in single address mode, use edge detection. .com .com .com .com 4 .com u datasheet
286 .com .com .com .com 4 .com u datasheet
287 section 10 division unit 10.1 overview the division unit (divu) divides 64 bits by 32 bits and 32 bits by 32 bits. the results are expressed as a 32-bit quotient and a 32-bit remainder. when the operation produces an overflow, an interrupt can be generated as specified. 10.1.1 features the division unit has the following features: ? performs signed division of 64 bits by 32 bits and 32 bits by 32 bits ? handles 32-bit quotient, 32-bit remainder ? completes operation execution in 39 cycles ? controls enabling/disabling of over/underflow interrupts ? even during the division process, instructions not accessing the division unit can be parallel- processed .com .com .com .com 4 .com u datasheet
288 10.1.2 block diagram figure 10.1 shows a block diagram of the division unit. vcrdiv dvcr dvdntl dvdnth dvdnt division control circuit bus interface division oper- ation circuit module data bus internal data bus internal interrupt signal dvsr dvsr: divisor register dvdnt: dividend register l for 32-bit division dvdnth: dividend register h dvdntl: dividend register l dvcr: division control register vcrdiv: vector number setting register div figure 10.1 division unit block diagram 10.1.3 register configuration table 10.1 shows the register configuration of the division unit. .com .com .com .com 4 .com u datasheet
289 table 10.1 division unit register configuration register abbr. r/w initial value address access size *1 divisor register dvsr r/w undefined h'ffffff00 32 dividend register l for 32-bit division dvdnt r/w undefined h'ffffff04 32 division control register dvcr r/w h'00000000 h'ffffff08 16, 32 vector number setting register div vcrdiv r/w undefined *2 h'ffffff0c 16, 32 dividend register h dvdnth r/w undefined h'ffffff10 32 dividend register l dvdntl r/w undefined h'ffffff14 32 notes: 1. accesses to the division unit are read and written in 32-bit units. dvcr and vcrdiv permit 16 and 32-bit accesses. when registers other than cont and vcrdiv are accessed with word accesses, undefined values are read or written. 2. the initial value of vcrdiv is h'0000**** (asterisks represent undefined values). 10.2 description of registers 10.2.1 divisor register (dvsr) bit: 31 30 29 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w the divisor register (dvsr) is a 32-bit read/write register in which the divisor for the operation is written. it is not initialized by a power-on reset or manual reset, in standby mode, or during module standbys. 10.2.2 dividend register l for 32-bit division (dvdnt) bit: 31 30 29 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w .com .com .com .com 4 .com u datasheet
290 the dividend register l for 32-bit division (dvdnt) is a 32-bit read/write register in which the 32-bit dividend used for 32-bit 32-bit division operations is written. when 32-bit 32-bit division is run, the value set as the dividend is lost and the quotient written at the end of division. when this register is written to, the same value is written in the dvdntl register. the msb written is sign-extended in the dvdnth register. writing to this register starts the 32-bit 32-bit division operation. it is not initialized by a power-on reset or manual reset, in standby mode, or during module standbys. 10.2.3 division control register (dvcr) bit: 31 30 29 3 2 1 0 bit name: ovfie ovf initial value: 0 0 0 0 0 0 0 r/w: r r r r r r/w r/w the division control register (dvcr) is a 32-bit read/write register, but is also 16-bit accessible. it controls enabling/disabling of the overflow interrupt. this register is initialized to h'00000000 by a power-on reset or manual reset. it is not initialized in standby mode or during module standbys. ? bits 31 to 2: reserved. these bits always read 0. the write value should always be 0. ? bit 1: ovf interrupt enable (ovfie): selects enabling or disabling of the ovf interrupt request (ovfi) upon overflow. bit 1: ovfie description 0 interrupt request (ovfi) caused by ovf disabled (initial value) 1 interrupt request (ovfi) caused by ovf enabled note: always set the ovfie bit before starting the operation whenever executing interrupt handling for overflows. ? bit 0: overflow flag (ovf). flag indicating an overflow has occurred. bit 0: ovf description 0 no overflow has occurred (initial value) 1 overflow has occurred .com .com .com .com 4 .com u datasheet
291 10.2.4 vector number setting register div (vcrdiv) bit: 31 30 29 19 18 17 16 bit name: initial value: 0 0 0 0 0 0 0 r/w: r r r r r r r bit: 15 14 13 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w vector number setting register div (vcrdiv) is a 32-bit read/write register, but is also 16-bit accessible. the destination vector number is set in vcrdiv when an interrupt occurs in the division unit due to an overflow or underflow. values can be set in the 16 bits from bit 15 to bit 0, but only the last 7 bits (bits 6?) are valid. always set 0 for the 9 bits from bit 15 to bit 7. vcrdiv is not initialized by a power-on reset or manual reset, in standby mode, or during module standbys. ? bits 31 to 7: reserved. these bits always read 0. the write value should always be 0. ? bits 6 to 0: interrupt vector number. sets the interrupt destination vector number. only the 7 bits 6? are valid (as the vector number). 10.2.5 dividend register h (dvdnth) bit: 31 30 39 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w dividend register h (dvdnth) is a 32-bit read/write register in which the upper 32 bits of the dividend used for 64 bit 32 bit division operations are written. when a division operation is executed, the value set as the dividend is lost and the remainder written here at the end of the operation. the initial value of dvdnth is undefined, and its value is also undefined after a power-on reset or manual reset, in standby mode, and during in module standbys. when the dvdnt register is set with a dividend value, the previous dvdnth value is lost and the msb of the dvdnt register is extended to all bits in the dvdnth register. .com .com .com .com 4 .com u datasheet
292 10.2.6 dividend register l (dvdntl) bit: 31 30 39 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w dividend register l (dvdntl) is a 32-bit read/write register in which the lower 32 bits of the dividend used for 64-bit 32-bit division operations are written. when a value is set in this register, the 64-bit 32-bit division operation begins. the value written in the dvdnt register for 32-bit 32-bit division is also set in this register. when a 64-bit 32-bit division operation is executed, the value set as the dividend is lost and the quotient written here at the end of the operation. the contents of this register are undefined after a power-on reset or manual reset, in standby mode, and during module standbys. 10.3 operation 10.3.1 64-bit 32-bit operations 64-bit 32-bit operations work as follows: 1. the 32-bit divisor is set in the divisor register (dvsr). 2. the 64-bit dividend is set in dividend registers h and l (dvdnth and dvdntl). first set the value in dvdnth. when a value is written to dvdntl, the 64-bit 32-bit operation begins. 3. this unit finishes a single operation in 39 cycles (starting from the setting of the value in dvdntl). when an overflow occurs, however, the operation ends in 6 cycles. see section 10.3.3, handling of overflows, for more information. note that operation is signed. 4. after the operation, the 32-bit remainder is written to dvdnth and the 32-bit quotient is written to dvdntl. 10.3.2 32-bit 32-bit operations 32-bit 32-bit operations work as follows: 1. the 32-bit divisor is set in the divisor register (dvsr). 2. the 32-bit dividend is set in dividend register l (dvdnt) for 32-bit division. when a value is written to dvdnt, the 32-bit 32-bit operation begins. 3. this unit finishes a single operation in 39 cycles (starting from the setting of the value in dvdnt). when an overflow occurs, however, the operation ends in 6 cycles. see section 10.3.3, handling of overflows, for more information. note that the operation is signed. .com .com .com .com 4 .com u datasheet
293 4. after the operation, the 32-bit remainder is written to dvdnth and the 32-bit quotient is written to dvdnt. 10.3.3 handling of overflows when the results of operations exceed the ranges expressed as signed 32 bits (when, in division between two negative numbers, the quotient is the maximum value and a remainder (negative number) is generated) or when the divisor is 0, an overflow will result. when an overflow occurs, the ovf bit is set and an overflow interrupt is generated if interrupt generation is enabled (the ovfie bit in dvcr is 1). the operation will then end with the result after 6 cycles of operation stored in the dvdnth and dvdntl registers. if interrupt generation is disabled (the ovfie bit is 0), the operation will end with the operation result at 6 cycles set in dvdnth and the maximum value h'7fffffff or minimum value h'80000000 set in dvdntl. in the sh7604, the maximum value results when a positive quotient overflows; the minimum value results when a negative quotient overflows. the first three cycles of the 6 cycles executed when an overflow occurs are used for flag setting within the division unit and the next three for division. 10.4 usage notes 10.4.1 access all accesses to the division unit except dvcr and vcrdiv must be 32-bit reads or writes. word accesses to registers other than dvcr and vcrdiv result in reading or writing of undefined values. in the division unit, a read instruction is extended for one cycle immediately after an instruction that writes to a register, even if the register is the same, to ensure that the value written is accurately set in the destination register in the division unit. when a read or write instruction is issued while the division unit is operating, the read or write instruction is continuously extended until the operation ends. this means that instructions that do not access the division unit can be parallel-processed. when an instruction is executed that writes to any register of the division unit immediately following an instruction that writes to the division start-up registers (dvdntl or dvdnt), the correct value may not be set in the start-up register. specify an instruction other than one that writes to a division unit register for the instruction immediately following instruction that writes to a start-up register. because of the above restrictions, efficient processing can be achieved by executing instructions that do not access the division unit for 39 cycles after starting the operation, then issuing a read instruction after the 39th cycle. .com .com .com .com 4 .com u datasheet
294 10.4.2 overflow flag when an overflow occurs, the overflow flag (ovf) is set and is not automatically reset. when ovf is set, the operation is not affected. when necessary, clear it before the operation. the states of registers when overflow occurs are shown in table 10.2. table 10.2 overflow processing register overflow interrupt enabled overflow interrupt disabled dvsr holds the value written holds the value written dvdnt holds the results of operations until overflow generation is detected* the maximum value is set for overflow to the plus side, or the minimum value for overflow to the minus side dvcr the ovf bit is set the ovf bit is set vcrdiv holds the value written holds the value written dvdnth holds the results of operations until overflow generation is detected* holds the results of operations until overflow generation is detected * dvdntl holds the results of operations until overflow generation is detected* the maximum value is set for overflow to the plus side, or the minimum value for overflow to the minus side note: in division processing, the intermediate operation result is written for cycles up to detection of overflow generation. .com .com .com .com 4 .com u datasheet
295 section 11 16-bit free-running timer 11.1 overview the sh7604 has a single-channel, 16-bit free-running timer (frt) on-chip. the frt is based on a 16-bit free-running counter (frc) and can output two types of independent waveforms. the frt can also measure the width of input pulses and the cycle of external clocks. 11.1.1 features the frt has the following features: ? allows selection between four types of counter input clocks. select from external clock or three types of internal clocks ( /8, /32, and /128). (external events can be counted.) ? two independent comparators. two types of waveforms can be output. ? input capture. select rising edge or falling edge. ? counter clear can be specified. the counter value can be cleared upon compare match a. ? four types of interrupt sources. two compare matches, one input capture, and one overflow are available as interrupt sources, and interrupts can be requested independently for each. .com .com .com .com 4 .com u datasheet
296 11.1.2 block diagram figure 11.1 shows a block diagram of the frt. fti /8 internal clock internal data bus module data bus /32 /128 ici interrupt signals ocia ocib ovi ftob ftoa ftci control logic clock select clock compare match a overflow clear compare match b capture ocra (h/l) comparator a frc (h/l) comparator b ocrb (h/l) icr (h/l) ftcsr tier tcr tocr bus interface ocra,b: output compare registers a,b (16 bits) frc: free-running counter (16 bits) icr: input capture register (16 bits) tcr: timer control register (8 bits) tier: timer interrupt enable register (8 bits) ftcsr: free-running timer control/status register (8 bits) tocr: timer output compare control register (8 bits) figure 11.1 frt block diagram .com .com .com .com 4 .com u datasheet
297 11.1.3 pin configuration table 11.1 lists frt i/o pins and their functions. table 11.1 pin configuration channel pin i/o function counter clock input pin ftci i frc counter clock input pin output compare a output pin ftoa o output pin for output compare a output compare b output pin ftob o output pin for output compare b input capture input pin fti i input pin for input capture 11.1.4 register configuration table 11.2 shows the frt register configuration. table 11.2 register configuration register abbreviation r/w initial value address timer interrupt enable register tier r/w h'01 hfffffe10 free-running timer control/status register ftcsr r/(w)* 1 h'00 hfffffe11 free-running counter h frc h r/w h'00 hfffffe12 free-running counter l frc l r/w h'00 hfffffe13 output compare register a h ocra h r/w h'ff hfffffe14* 2 output compare register a l ocra l r/w h'ff hfffffe15* 2 output compare register b h ocrb h r/w h'ff hfffffe14* 2 output compare register b l ocrb l r/w h'ff hfffffe15* 2 timer control register tcr r/w h'00 hfffffe16 timer output compare control register tocr r/w h'e0 hfffffe17 input capture register h icr h r h'00 hfffffe18 input capture register l icr l r h'00 hfffffe19 notes: 1. bits 7 to 1 are read-only. the only value that can be written is a 0, which is used to clear flags. bit 0 can be read or written. 2. ocra and ocrb have the same address. the ocrs bit in tocr is used to switch between them. 3. use byte-size access for all registers. .com .com .com .com 4 .com u datasheet
298 11.2 register descriptions 11.2.1 free-running counter (frc) bit: 15 14 13 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w frc is a 16-bit read/write up-counter. it increments upon input of a clock. the input clock can be selected using clock select bits 1 and 0 (cks1, cks0) in tcr. frc can be cleared upon compare match a. when frc overflows (h'ffff h'0000), the overflow flag (ovf) in ftcsr is set to 1. frc can be read or written to by the cpu, but because it is 16 bits long, data transfers involving the cpu are performed via a temporary register (temp). see section 11.3, cpu interface, for more detailed information. frc is initialized to h'0000 by a reset, in standby mode, and when the module standby function is used. 11.2.2 output compare registers a and b (ocra and ocrb) bit: 15 14 13 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w ocr is composed of two 16-bit read/write registers (ocra and ocrb). the contents of ocr are always compared to the frc value. when the two values are the same, the output compare flags in ftcsr (ocfa and ocfb) are set to 1. when the ocr and frc values are the same (compare match), the output level values set in the output level bits (olvla and olvlb) are output to the output compare pins (ftoa and ftob). after a reset, ftoa and ftob output 0 until the first compare match occurs. because ocr is a 16-bit register, data transfers involving the cpu are performed via a temporary register (temp). see section 11.3, cpu interface, for more detailed information. ocr is initialized to h'ffff by a reset, in standby mode, and when the module standby function is used. .com .com .com .com 4 .com u datasheet
299 11.2.3 input capture register (icr) bit: 15 14 13 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 r/w: r r r r r r r icr is a 16-bit read-only register. when a rising edge or falling edge of the input capture signal is detected, the current frc value is transferred to icr. at the same time, the input capture flag (icf) in ftcsr is set to 1. the edge of the input signal can be selected using the input edge select bit (iedga) in tcr. because icr is a 16-bit register, data transfers involving the cpu are performed via a temporary register (temp). see section 11.3, cpu interface, for more detailed information. to ensure that the input capture operation is reliably performed, set the pulse width of the input capture input signal to six system clocks ( ) or more. icr is initialized to h'0000 by a reset, in standby mode, and when the module standby function is used. 11.2.4 timer interrupt enable register (tier) bit: 7 6 5 4 3 2 1 0 bit name: icie ociae ocibe ovie initial value: 0 0 0 0 0 0 0 1 r/w: r/w r/w r/w r/w tier is an 8-bit read/write register that controls enabling of all interrupt requests. tier is initialized to h'01 by a reset, in standby mode, and when the module standby function is used. ? bit 7?nput capture interrupt enable (icie): selects enabling/disabling of the ici interrupt request when the input capture flag (icf) in ftcsr is set to 1. bit 7: icie description 0 interrupt request (ici) caused by icf disabled (initial value) 1 interrupt request (ici) caused by icf enabled ? bits 6 to 4?eserved: these bits always read 0. the write value should always be 0. do not write 1. .com .com .com .com 4 .com u datasheet
300 ? bit 3?utput compare interrupt a enable (ociae): selects enabling/disabling of the ocia interrupt request when the output compare flag a (ocfa) in ftcsr is set to 1. bit 3: ociae description 0 interrupt request (ocia) caused by ocfa disabled (initial value) 1 interrupt request (ocia) caused by ocfa enabled ? bit 2?utput compare interrupt b enable (ocibe): selects enabling/disabling of the ocib interrupt request when the output compare flag b (ocfb) in ftcsr is set to 1. bit 2: ocibe description 0 interrupt request (ocib) caused by ocfb disabled (initial value) 1 interrupt request (ocib) caused by ocfb enabled ? bit 1?imer overflow interrupt enable (ovie): selects enabling/disabling of the ovi interrupt request when the overflow flag (ovf) in ftcsr is set to 1. bit 1: ovie description 0 interrupt request (fovi) caused by ovf disabled (initial value) 1 interrupt request (fovi) caused by ovf enabled ? bit 0?eserved: this bit always reads 1. the write value should always be 1. 11.2.5 free-running timer control/status register (ftcsr) bit: 7 6 5 4 3 2 1 0 bit name: icf ocfa ocfb ovf cclra initial value: 0 0 0 0 0 0 0 0 r/w: r/(w)* r/(w)* r/(w)* r/(w)* r/w note: for bits 7, and 3 to 1, the only value that can be written is 0 (to clear the flags). ftcsr is an 8-bit register that selects counter clearing and controls interrupt request signals. ftcsr is initialized to h'00 by a reset, in standby mode, and when the module standby function is used. see section 11.4, operation, for the timing. ? bit 7?nput capture flag (icf): status flag that indicates that the frc value has been sent to ficr by the input capture signal. this flag is cleared by software and set by hardware. it cannot be set by software. .com .com .com .com 4 .com u datasheet
301 bit 7: icf description 0 clear conditions: when icf is read while set to 1, and then 0 is written to it (initial value) 1 set conditions: when the frc value is sent to icr by the input capture signal ? bits 6 to 4?eserved: these bits always read 0. the write value should always be 0. ? bit 3?utput compare flag a (ocfa): status flag that indicates when the values of the frc and ocra match. this flag is cleared by software and set by hardware. it cannot be set by software. bit 3: ocfa description 0 clear conditions: when ocfa is read while set to 1, and then 0 is written to it (initial value) 1 set conditions: when the frc value becomes equal to ocra ? bit 2?utput compare flag b (ocfb): status flag that indicates when the values of frc and ocrb match. this flag is cleared by software and set by hardware. it cannot be set by software. bit 2: ocfb description 0 clear conditions: when ocfb is read while set to 1, and then 0 is written to it (initial value) 1 set conditions: when the frc value becomes equal to ocrb ? bit 1?imer overflow flag (ovf): status flag that indicates when frc overflows (from h'ffff to h'0000). this flag is cleared by software and set by hardware. it cannot be set by software. bit 1: ovf description 0 clear conditions: when ovf is read while set to 1, and then 0 is written to it (initial value) 1 set conditions: when the frc value changes from h'ffff to h'0000 ? bit 0?ounter clear a (cclra): selects whether or not to clear frc on compare match a (signal indicating match of frc and ocra). .com .com .com .com 4 .com u datasheet
302 bit 0: cclra description 0 frc clear disabled (initial value) 1 frc cleared on compare match a 11.2.6 timer control register (tcr) bit: 7 6 5 4 3 2 1 0 bit name: iedga cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tcr is an 8-bit read/write register that selects the input edge for input capture and selects the input clock for frc. tcr is initialized to h'00 by a reset, in standby mode, and when the module standby function is used. ? bit 7?nput edge select (iedg): selects whether to capture the input capture input (fti) on the falling edge or rising edge. bit 7: iedg description 0 input captured on falling edge (initial value) 1 input captured on rising edge ? bits 6 to 2?eserved: these bits always read 0. the write value should always be 0. do not write 1. ? bits 1 and 0?lock select (cks1, cks0): these bits select whether to use an external clock or one of three internal clocks for input to frc. the external clock is counted at the rising edge. bit 1: cks1 bit 0: cks0 description 0 0 internal clock: count at /8 (initial value) 1 internal clock: count at /32 1 0 internal clock: count at /128 1 external clock: count at rising edge .com .com .com .com 4 .com u datasheet
303 11.2.7 timer output compare control register (tocr) bit: 7 6 5 4 3 2 1 0 bit name: ocrs olvla olvlb initial value: 1 1 1 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w tocr is an 8-bit read/write register that selects the output level for output compare, enables output compare output, and controls switching between access of output compare registers a and b. tocr is initialized to h'e0 by a reset, in standby mode, and when the module standby function is used. bits 7 to 5?eserved: these bits always read 1. the write value should always be 1. do not write 0. bit 4?utput compare register select (ocrs): ocra and ocrb share the same address. the ocrs bit controls which register is selected when reading/writing to this address. it does not affect the operation of ocra and ocrb. bit 4: ocrs description 0 ocra register selected (initial value) 1 ocrb register selected bits 3 and 2?eserved: these bits always read 0. the write value should always be 0. do not write 1. bit 1?utput level a (olvla): selects the level output to the output compare a output pin upon compare match a (signal indicating match of frc and ocra). bit 1: olvla description 0 0 output on compare match a (initial value) 1 1 output on compare match a bit 0?utput level b (olvlb): selects the level output to the output compare b output pin upon compare match b (signal indicating match of frc and ocrb). bit 0: olvlb description 0 0 output on compare match b (initial value) 1 1 output on compare match b .com .com .com .com 4 .com u datasheet
304 11.3 cpu interface frc, ocra, ocrb, and ficr are 16-bit registers. the data bus width between the cpu and frt, however, is only 8 bits. access of these three types of registers from the cpu therefore needs to be performed via an 8-bit temporary register called temp. the following describes how these registers are read from and written to: ? writing to 16-bit registers the upper byte is written, which results in the upper byte of data being stored in temp. the lower byte is then written, which results in 16 bits of data being written to the register when combined with the upper byte value in temp. ? reading from 16-bit registers the upper byte of data is read, which results in the upper byte value being transferred to the cpu. the lower byte value is transferred to temp. the lower byte is then read, which results in the lower byte value in temp being sent to the cpu. when registers of these three types are accessed, two byte accesses should always be performed, first to the upper byte, then the lower byte. the same applies to accesses with the on-chip direct memory access controller. if only the upper byte or lower byte is accessed, the data will not be transferred properly. figure 11.2 and 11.3 show the flow of data when frc is accessed. other registers function in the same way. when reading ocra and ocrb, however, both upper and lower-byte data is transferred directly to the cpu without passing through temp. .com .com .com .com 4 .com u datasheet
305 cpu (h'aa) upper byte data bus within module bus interface temp (h'aa) frc h ( ) frc l ( ) (write to upper byte) cpu (h'55) lower byte data bus within module bus interface temp (h'aa) frc h (h'aa) frc l (h'55) (write to lower byte) figure 11.2 frc access operation (cpu writes h'aa55 to frc) .com .com .com .com 4 .com u datasheet
306 cpu (h'aa) upper byte temp (h'55) frc h (h'aa) frc l (h'55) data bus within module bus interface (read from upper byte) cpu (h'55) lower byte temp (h'aa) frc h ( ) frc l ( ) data bus within module bus interface (read from lower byte) figure 11.3 frc access operation (cpu reads h'aa55 from frc) .com .com .com .com 4 .com u datasheet
307 11.4 operation 11.4.1 frc count timing the frc increments on clock input (internal or external). internal clock operation: set the cks1 and cks0 bits in tcr to select which of the three internal clocks created by dividing system clock ( /8, /32, /128) is used. figure 11.4 shows the timing. timer drive clock n 1 n n + 1 internal clock frc input clock frc figure 11.4 count timing (internal clock operation) external clock operation: set the cks1 and cks0 bits in tcr to select the external clock. external clock pulses are counted on the rising edge. the pulse width of the external clock must be at least 6 system clocks ( ). a smaller pulse width will result in inaccurate operation. figures 11.5 shows the timing. timer drive clock n n + 1 external clock input pin frc input clock frc figure 11.5 count timing (external clock operation) .com .com .com .com 4 .com u datasheet
308 11.4.2 output timing for output compare when a compare match occurs, the output level set in the olvl bit in tocr is output from the output compare output pins (ftoa, ftob). figure 11.6 shows the timing for output of output compare a. clear* nn nn n + 1 n + 1 timer drive clock frc ocra compare match a signal olvla output compare a output pin ftoa note: indicates instruction execution by software figure 11.6 output timing for output compare a 11.4.3 frc clear timing frc can be cleared on compare match a. figure 11.7 shows the timing. timer drive clock compare match a signal frc n h'0000 figure 11.7 compare match a clear timing .com .com .com .com 4 .com u datasheet
309 11.4.4 input capture input timing either the rising edge or falling edge, can be selected for input capture input using the iedg bit in tcr. figure 11.8 shows the timing when the rising edge is selected (iedg = 1). timer drive clock input capture input pin input capture signal figure 11.8 input capture signal timing (normal) when the input capture signal is input when icr is read (upper-byte read), the input capture signal is delayed by one cycle of the clock that drives the timer. figure 11.9 shows the timing. timer drive clock input capture input pin input capture signal icr upper-byte read cycle figure 11.9 input capture signal timing (input capture input when icr is read) .com .com .com .com 4 .com u datasheet
310 11.4.5 input capture flag (icf) setting timing input capture input sets the input capture flag (icf) to 1 and simultaneously transfers the frc value to icr. figure 11.10 shows the timing. timer drive clock input capture signal icf frc icr n n figure 11.10 icf setting timing 11.4.6 output compare flag (ocfa, ocfb) setting timing the compare match signal output (when ocra or ocrb matches the frc value) sets output compare flag ocfa or ocfb to 1. the compare match signal is generated in the last state in which the values matched (at the timing for updating the count value that matched the frc). after ocra or ocrb matches the frc, no compare match signal is generated until the increment lock is generated. figure 11.11 shows the timing for setting ocfa and ocfb. .com .com .com .com 4 .com u datasheet
311 timer drive clock frc ocra, ocrb compare match signal ocfa, ocfb n + 1 n n figure 11.11 ocf setting timing 11.4.7 timer overflow flag (ovf) setting timing frc overflow (from h'ffff to h'0000) sets the timer overflow flag (ovf) to 1. figure 11.12 shows the timing. timer drive clock frc overflow signal ovf h'0000 h'ffff figure 11.12 ovf setting timing .com .com .com .com 4 .com u datasheet
312 11.5 interrupt sources there are four frt interrupt sources of three types (ici, ocia/ocib, and ovi). table 11.3 lists the interrupt sources and their priorities after a reset is cleared. the interrupt enable bits in tier are used to enable or disable the interrupt bits. each interrupt request is sent to the interrupt controller independently. see section 4, exception handling, for more information about priorities and the relationship to interrupts other than those of the frt. table 11.3 frt interrupt sources and priorities interrupt source description priority ici interrupt by icf high ocia, ocib interrupt by ocfa or ocfb ovi interrupt by ovf low 11.6 example of frt use figure 11.13 shows an example in which pulses with a 50% duty factor and arbitrary phase relationship are output. the procedure is as follows: 1. set the cclra bit in ftcsr to 1. 2. the olvla and olvlb bits are inverted by software whenever a compare match occurs. h'ffff ocra ocrb h'0000 ftoa ftob frc counter clear figure 11.13 example of pulse output .com .com .com .com 4 .com u datasheet
313 11.7 usage notes note that the following contention and operations occur when the frt is operating: 1. frc operates on the timer drive clock ( /4), which has a cycle of 4 times the system clock ( ). for this reason, when the cpu performs an access, both the cpu and frt will be operating, so a wait request will be generated from the frt to the cpu. the number of access cycles thus varies by between 3 and 12 cycles. 2. contention between frc write and clear when a counter clear signal is generated with the timing shown in figure 11.14 during the write cycle for the lower byte of frc, writing does not occur to the frc, and the frc clear takes priority. timer drive clock frc lower-byte write cycle address internal write signal counter clear signal frc frc address n h'0000 figure 11.14 contention between frc write and clear 3. contention between frc write and increment when an increment occurs with the timing shown in figure 11.15 during the write cycle for the lower byte of frc, no increment is performed and the counter write takes priority. .com .com .com .com 4 .com u datasheet
314 frc frc address nm write data timer drive clock frc upper-byte write cycle address internal write signal frc input clock figure 11.15 contention between frc write and increment 4. contention between ocr write and compare match when a compare match occurs with the timing shown in figure 11.16, during the write cycle for the lower byte of ocra or ocrb, the ocr write takes priority and the compare match signal is disabled. .com .com .com .com 4 .com u datasheet
315 frc compare match signal ocr ocr address nm n n + 1 write data disabled timer drive clock frc lower-byte write cycle address internal write signal figure 11.16 contention between ocr and compare match 5. internal clock switching and counter operation frc will sometimes begin incrementing because of the timing of switching between internal clocks. table 11.4 shows the relationship between internal clock switching timing (cks1 and cks0 bit rewrites) and frc operation. when an internal clock is used, the frc clock is generated when the falling edge of an internal clock (created by dividing the system clock ( )) is detected. when a clock is switched to high before the switching and to low after switching, as shown in case 3 in table 11.4, the switchover is considered a falling edge and an frc clock pulse is generated, causing frc to increment. frc may also increment when switching between an internal clock and an external clock. .com .com .com .com 4 .com u datasheet
316 table 11.4 internal clock switching and frc operation no. timing of rewrite of cks1 and cks0 bits frc operation 1 low-to-low switch clock before switching clock after switching frc clock frc n n + 1 rewrite of cks bit 2 low-to-high switch n n + 1 n + 2 clock before switching clock after switching frc clock frc rewrite of cks bit .com .com .com .com 4 .com u datasheet
317 table 11.4 internal clock switching and frc operation (cont) no. timing of rewrite of cks1 and cks0 bits frc operation 3 high-to-low switch n n + 1 n + 2 clock before switching clock after switching frc clock frc rewrite of cks bit 4 high-to-high switch n n + 1 n + 2 clock before switching clock after switching frc clock frc rewrite of cks bit note: because the switchover is considered a falling edge, frc starts counting up. 6. timer output (ftoa, ftob) during a power-on reset, the timer outputs (ftoa, ftob) will be unreliable until the oscillation stabilizes. the initial value is output after the oscillation settling time has elapsed. .com .com .com .com 4 .com u datasheet
318 .com .com .com .com 4 .com u datasheet
319 section 12 watchdog timer (wdt) 12.1 overview the sh7604 has a single-channel watchdog timer (wdt) for monitoring system operations. if a system becomes uncontrolled and the timer counter overflows without being rewritten correctly by the cpu, an overflow signal ( wdtovf ) is output externally. the wdt can simultaneously generate an internal reset signal for the entire chip. when this watchdog function is not needed, the wdt can be used as an interval timer. in the interval timer operation, an interval timer interrupt is generated at each counter overflow. the wdt is also used when recovering from standby mode, in modifying a clock frequency, and in clock pause mode. 12.1.1 features ? works in watchdog timer mode or interval timer mode. ? outputs wdtovf in watchdog timer mode. when the counter overflows in watchdog timer mode, overflow signal wdtovf is output externally. it is possible to select whether to reset the chip internally when this happens. either the power-on reset or manual reset signal can be selected as the internal reset signal. ? generates interrupts in interval timer mode. when the counter overflows, it generates an interval timer interrupt. ? used for standby mode clearing, clock frequency modification, and clock pause mode. ? works with eight counter clock sources. .com .com .com .com 4 .com u datasheet
320 12.1.2 block diagram figure 12.1 shows a block diagram of the wdt. /2 /64 /128 /256 /512 /1024 /4096 /8192 internal clock clock overflow clock select interrupt control reset control rstcsr tcnt tcsr module bus bus interface interna bus iti (interrupt request signal) wdtovf internal reset signal* wdt wtcsr: watchdog timer control/status register wtcnt: watchdog timer counter rstcsr: reset control/status register note: the internal reset signal can be generated by a register setting. the type of reset can be selected (power-on or manual reset). figure 12.1 wdt block diagram 12.1.3 pin configuration table 12.1 shows the pin configuration. table 12.1 pin configuration pin abbreviation i/o function watchdog timer overflow wdtovf o outputs the counter overflow signal in watchdog mode .com .com .com .com 4 .com u datasheet
321 12.1.4 register configuration table 12.2 summarizes the three wdt registers. they are used to select the clock, switch the wdt mode, and control the reset signal. table 12.2 wdt registers address name abbreviation r/w initial value write *1 read * 2 watchdog timer control/status register wtcsr r/(w)* 3 h'18 h'fffffe80 h'fffffe80 watchdog timer counter wtcnt r/w h'00 h'fffffe80 h'fffffe81 reset control/status register rstcsr r/(w)* 3 h'1f h'fffffe82 h'fffffe83 notes: 1. write by word access. it cannot be written by byte or longword access. 2. read by byte access. the correct value cannot be read by word or longword access. 3. only 0 can be written in bit 7 to clear the flag. 12.2 register descriptions 12.2.1 watchdog timer counter (wtcnt) wtcnt is an 8-bit read/write up-counter. wtcnt differs from other registers in that it is more difficult to write. see section 12.2.4, register access, for details. when the timer enable bit (tme) in the watchdog timer control/status register (wtcsr) is set to 1, the watchdog timer counter starts counting pulses of an internal clock source selected by clock select bits 2 to 0 (cks2 to cks0) in wtcsr. when the value of wtcnt overflows (changes from h'ff to h'00), a watchdog timer overflow signal ( wdtovf ) or interval timer interrupt (iti) is generated, depending on the mode selected in the wt/ it bit in wtcsr. wtcnt is initialized to h'00 by a reset and when the tme bit is cleared to 0. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w .com .com .com .com 4 .com u datasheet
322 12.2.2 watchdog timer control/status register (wtcsr) the watchdog timer control/status register (wtcsr) is an 8-bit read/write register. wtcsr differs from other registers in being more difficult to write. see section 12.2.4, register access, for details. its functions include selecting the timer mode and clock source. bits 7 to 5 are initialized to 000 by a reset and in standby mode. bits 2 to 0 are initialized to 000 by a reset, but retain their values in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: ovf wt/ it tme cks2 cks1 cks0 initial value: 0 0 0 1 1 0 0 0 r/w: r/(w) r/w r/w r/w r/w r/w ? bit 7?verflow flag (ovf): indicates that wtcnt has overflowed from h'ff to h'00. it is not set in watchdog timer mode. bit 7: ovf description 0 no overflow of wtcnt in interval timer mode (initial value) cleared by reading ovf, then writing 0 in ovf 1 wtcnt overflow in interval timer mode ? bit 6?imer mode select (wt/ it ): selects whether to use the wdt as a watchdog timer or interval timer. when wtcnt overflows, the wdt either generates an interval timer interrupt (iti) or generates a wdtovf signal, depending on the mode selected. bit 6: wt/ it description 0 interval timer mode: interval timer interrupt (iti) request to the cpu when wtcnt overflows (initial value) 1 watchdog timer mode: wdtovf signal output externally when wtcnt overflows. section 12.2.3, reset control/status register (rstcsr), describes in detail what happens when wtcnt overflows in watchdog timer mode. ? bit 5?imer enable (tme): enables or disables the timer. bit 5: tme description 0 timer disabled: wtcnt is initialized to h'00 and count-up stops (initial value) 1 timer enabled: wtcnt starts counting. a wdtovf signal or interrupt is generated when wtcnt overflows. .com .com .com .com 4 .com u datasheet
323 ? bits 4 and 3?eserved: these bits always read 1. the write value shoul always be 1. ? bits 2 to 0?lock select 2 to 0 (cks2 to cks0): these bits select one of eight internal clock sources for input to wtcnt. the clock signals are obtained by dividing the frequency of the system clock ( ). description bit 2: cks2 bit 1: cks1 bit 0: cks0 clock source overflow interval* ( = 28.7 mhz) 000 /2 (initial value) 17.8 s 001 /64 570.8 s 010 /128 1.1 ms 011 /256 2.2 ms 100 /512 4.5 ms 101 /1024 9.1 ms 110 /4096 36.5 ms 111 /8192 73.0 ms note: the overflow interval listed is the time from when the wtcnt begins counting at h'00 until an overflow occurs. 12.2.3 reset control/status register (rstcsr) rstcsr is an eight-bit read/write register that controls output of the reset signal generated by watchdog timer counter (wtcnt) overflow and selects the internal reset signal type. rstcsr differs from other registers in that it is more difficult to write. see section 12.2.4, register access, for details. rstcr is initialized to h'1f by input of a reset signal from the res pin, but is not initialized by the internal reset signal generated by overflow of the wdt. it is initialized to h'1f in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: wovf rste rsts initial value: 0 0 0 1 1 1 1 1 r/w: r/(w)* r/w r/w note: only 0 can be written in bit 7 to clear the flag. ? bit 7?atchdog timer overflow flag (wovf): indicates that wtcnt has overflowed (from h'ff to h'00) in watchdog timer mode. it is not set in interval timer mode. .com .com .com .com 4 .com u datasheet
324 bit 7: wovf description 0 no wtcnt overflow in watchdog timer mode (initial value) cleared by reading wovf, then writing 0 in wovf 1 set by wtcnt overflow in watchdog timer mode ? bit 6?eset enable (rste): selects whether to reset the chip internally if wtcnt overflows in watchdog timer mode. bit 6: rste description 0 not reset when wtcnt overflows (initial value) lsi not reset internally, but wtcnt and wtcsr reset within wdt 1 reset when wtcnt overflows ? bit 5?eset select (rsts): selects the type of internal reset generated if wtcnt overflows in watchdog timer mode. bit 5: rsts description 0 power-on reset (initial value) 1 manual reset ? bits 4 to 0?eserved: these bits always read as 1. the write value should always be 1. 12.2.4 register access the watchdog timer? wtcnt, wtcsr, and rstcsr registers differ from other registers in that they are more difficult to write. the procedures for writing and reading these registers are given below. writing to wtcnt and wtcsr: these registers must be written by a word transfer instruction. they cannot be written by byte or longword transfer instructions. wtcnt and wtcsr both have the same write address. the write data must be contained in the lower byte of the written word. the upper byte must be h'5a (for wtcnt) or h'a5 (for wtcsr) (figure 12.2). this transfers the write data from the lower byte to wtcnt or wtcsr. .com .com .com .com 4 .com u datasheet
325 writing to wtcnt 15 8 7 0 address: h'fffffe80 h'5a write data writing to wtcsr 15 8 7 0 address: h'fffffe80 h'a5 write data figure 12.2 writing to wtcnt and wtcsr writing to rstcsr: rstcsr must be written by a word access to address h'fffffe82. it cannot be written by byte or longword transfer instructions. procedures for writing 0 in wovf (bit 7) and for writing to rste (bit 6) and rsts (bit 5) are different, as shown in figure 12.3. to write 0 in the wovf bit, the write data must be h'a5 in the upper byte and h'00 in the lower byte. this clears the wovf bit to 0. the rste and rsts bits are not affected. to write to the rste and rsts bits, the upper byte must be h'5a and the lower byte must be the write data. the values of bits 6 and 5 of the lower byte are transferred to the rste and rsts bits, respectively. the wovf bit is not affected. writing 0 to the wovf bit 15 8 7 0 address: h'fffffe82 h'a5 h'00 writing to the rste and rsts bits 15 8 7 0 address: h'fffffe82 h'5a write data figure 12.3 writing to rstcsr reading from wtcnt, wtcsr, and rstcsr: wtcnt, wtcsr, and rstcsr are read like other registers. use byte transfer instructions. the read addresses are h'fffffe80 for wtcsr, h'fffffe81 for wtcnt, and h'fffffe83 for rstcsr. .com .com .com .com 4 .com u datasheet
326 12.3 operation 12.3.1 operation in watchdog timer mode to use the wdt as a watchdog timer, set the wt/ it and tme bits in wtcsr to 1. software must prevent wtcnt overflow by rewriting the wtcnt value (normally by writing h'00) before overflow occurs. if wtcnt fails to be rewritten and overflows occur due to a system crash or the like, a wdtovf signal is output (figure 12.4). the wdtovf signal can be used to reset the system. the wdtovf signal is output for 128 clock cycles. if the rste bit in rstcsr is set to 1, a signal to reset the chip will be generated internally simultaneously with the wdtovf signal when wtcnt overflows. either a power-on reset or a manual reset can be selected by the rsts bit. the internal reset signal is output for 512 clock cycles. when a watchdog reset is generated simultaneously with input at the res pin, the software distinguishes the res reset from the watchdog reset by checking the wovf bit in rstcsr. the res reset takes priority. the wovf bit is cleared to 0. .com .com .com .com 4 .com u datasheet
327 wovf = 1 wtcnt value overflow wt/ it it wdtovf wdtovf it figure 12.4 operation in watchdog timer mode .com .com .com .com 4 .com u datasheet
328 12.3.2 operation in interval timer mode to use the wdt as an interval timer, clear wt/ it to 0 and set tme to 1 in wtscr. an interval timer interrupt (iti) is generated each time the watchdog timer counter (wtcnt) overflows. this function can be used to generate interval timer interrupts at regular intervals (figure 12.5). iti iti iti iti wtcnt value overflow overflow overflow overflow wt/ it = 0 tme = 1 h'ff h'00 time iti: interval timer interrupt request generation figure 12.5 operation in interval timer mode 12.3.3 operation in standby mode the watchdog timer has a special function to clear standby mode with an nmi interrupt. when using standby mode, set the wdt as described below. transition to standby mode: the tme bit in wtcsr must be cleared to 0 to stop the watchdog timer counter before it enters standby mode. the chip cannot enter standby mode while the tme bit is set to 1. set bits cks2 to cks0 in wtcsr so that the counter overflow interval is equal to or longer than the oscillation settling time. see section15.3, ac characteristics, for the oscillation settling time. recovery from standby mode: when an nmi request signal is received in standby mode the clock oscillator starts running and the watchdog timer starts counting at the rate selected by bits cks2 to cks0 before standby mode was entered. when wtcnt overflows (changes from h'ff to h'00) the system clock ( ) is presumed to be stable and usable; clock signals are supplied to the entire chip and standby mode ends. for details on standby mode, see section 14, power down modes. .com .com .com .com 4 .com u datasheet
329 12.3.4 timing of overflow flag (ovf) setting in interval timer mode, when wtcnt overflows, the ovf flag in wtcsr is set to 1 and an interval timer interrupt (iti) is requested (figure 12.6). figure 12.6 timing of ovf setting 12.3.5 timing of watchdog timer overflow flag (wovf) setting when wtcnt overflows the wovf flag in rstcsr is set to 1 and a wdtovf signal is output. when the rste bit is set to 1, wtcnt overflow enables an internal reset signal to be generated for the entire chip (figure 12.7). figure 12.7 timing of wovf setting .com .com .com .com 4 .com u datasheet
330 12.4 usage notes 12.4.1 contention between wtcnt write and increment if a timer counter clock pulse is generated during the t3 state of a write cycle to wtcnt, the write takes priority and the timer counter is not incremented (figure 12.8). wtcnt address address internal write signal wtcnt input clock wtcnt figure 12.8 contention between wtcnt write and increment 12.4.2 changing cks2 to cks0 bit values if the values of bits cks2 to cks0 are altered while the wdt is running, the count may increment incorrectly. always stop the watchdog timer (by clearing the tme bit to 0) before changing the values of bits cks2 to cks0. 12.4.3 switching between watchdog timer and interval timer mode to prevent incorrect operation, always stop the watchdog timer (by clearing the tme bit to 0) before switching between interval timer mode and watchdog timer mode. .com .com .com .com 4 .com u datasheet
331 12.4.4 system reset with wdtovf if a wdtovf signal is input to the res pin, the device cannot initialize correctly. avoid logical input of the wdtovf output signal to the res input pin. to reset the entire system with the wdtovf signal, use the circuit shown in figure 12.9. reset input reset signal to entire system res wdtovf figure 12.9 example of circuit for system reset with wdtovf signal 12.4.5 internal reset in watchdog timer mode if the rste bit is cleared to 0 in watchdog timer mode, the chip will not reset internally when a wtcnt overflow occurs, but wtcnt and wtcsr in the wdt will reset. .com .com .com .com 4 .com u datasheet
332 .com .com .com .com 4 .com u datasheet
333 section 13 serial communication interface 13.1 overview the sh7604 has a serial communication interface (sci) that supports both asynchronous and clocked synchronous serial communication. it also has a multiprocessor communication function for serial communication among two or more processors. 13.1.1 features selection of asynchronous or clock synchronous as the serial communication mode ? asynchronous mode: ? serial data communication is synchronized by the start-stop method in character units. the sci can communicate with a universal asynchronous receiver/transmitter (uart), an asynchronous communication interface adapter (acia), or any other chip that employs standard asynchronous serial communication. it can also communicate with two or more other processors using the multiprocessor communication function. there are twelve selectable serial data communication formats. ? data length: seven or eight bits ? stop bit length: one or two bits ? parity: even, odd, or none ? multiprocessor bit: one or none ? receive error detection: parity, overrun, and framing errors ? clocked synchronous mode: ? serial data communication is synchronized with a clock signal. the sci can communicate with other chips having a clocked synchronous communication function. there is one serial data communication format. ? data length: eight bits ? receive error detection: overrun errors ? full duplex communication. the transmitting and receiving sections are independent, so the sci can transmit and receive simultaneously. both sections use double buffering, so continuous data transfer is possible in both the transmit and receive directions. ? built-in baud rate generator with selectable bit rates ? internal or external transmit/receive clock source. baud rate generator (internal) or sck pin (external) ? four types of interrupts. transmit-data-empty, transmit-end, receive-data-full, and receive- error interrupts are requested independently. the transmit-data-empty and receive-data-full interrupts can start the direct memory access controller (dmac) to transfer data. .com .com .com .com 4 .com u datasheet
334 13.1.2 block diagram figure 13.1 shows a block diagram of the sci. rxd txd sck sci brr ssr scr tdr tsr rdr rsr smr parity generation parity check clock external clock module data bus internal data bus /4 /16 /64 /256 tei txi rxi eri bus interface baud rate generator transmit/ receive control rsr: receive shift register smr: serial mode register rdr: receive data register scr: serial control register tsr: transmit shift register ssr: serial status register tdr: transmit data register brr: bit rate register figure 13.1 sci block diagram 13.1.3 pin configuration table 13.1 summarizes the sci pins. table 13.1 sci pins pin name abbreviation input/output function serial clock pin sck input/output clock input/output receive data pin rxd input receive data input transmit data pin txd output transmit data output .com .com .com .com 4 .com u datasheet
335 13.1.4 register configuration table 13.2 summarizes the sci internal registers. these registers select the communication mode (asynchronous or clock synchronous), specify the data format and bit rate, and control the transmitter and receiver sections. table 13.2 registers name abbreviation r/w initial value address access size serial mode register smr r/w h'00 h'fffffe00 8 bit rate register brr r/w h'ff h'fffffe01 8 serial control register scr r/w h'00 h'fffffe02 8 transmit data register tdr r/w h'ff h'fffffe03 8 serial status register ssr r/(w) * h'84 h'fffffe04 8 receive data register rdr r h'00 h'fffffe05 8 note: the only value that can be written is a 0 to clear the flags. 13.2 register descriptions 13.2.1 receive shift register (rsr) the receive shift register (rsr) receives serial data. data input at the rxd pin is loaded into rsr in the order received, lsb (bit 0) first, converting the data to parallel form. when one byte has been received, it is automatically transferred to rdr. the cpu cannot read or write to rsr directly. bit: 7 6 5 4 3 2 1 0 bit name: r/w: 13.2.2 receive data register (rdr) the receive data register (rdr) stores serial receive data. the sci completes the reception of one byte of serial data by moving the received data from the receive shift register (rsr) into rdr for storage. rsr is then ready to receive the next data. this double buffering allows the sci to receive data continuously. the cpu can read but not write to rdr. rdr is initialized to h'00 by a reset and in standby and module standby mode. .com .com .com .com 4 .com u datasheet
336 bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r 13.2.3 transmit shift register (tsr) the transmit shift register (tsr) transmits serial data. the sci loads transmit data from the transmit data register (tdr) into tsr, then transmits the data serially from the txd pin, lsb (bit 0) first. after transmitting one data byte, the sci automatically loads the next transmit data from tdr into tsr and starts transmitting again. if the tdre bit in ssr is 1, however, the sci does not load the tdr contents into tsr. the cpu cannot read or write to tsr directly. bit: 7 6 5 4 3 2 1 0 bit name: r/w: 13.2.4 transmit data register (tdr) the transmit data register (tdr) is an 8-bit register that stores data for serial transmission. when the sci detects that the transmit shift register (tsr) is empty, it moves transmit data written in tdr into tsr and starts serial transmission. continuous serial transmission is possible by writing the next transmit data in tdr during serial transmission from tsr. the cpu can always read and write to tdr. tdr is initialized to h'ff by a reset and in standby and module standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w 13.2.5 serial mode register (smr) the serial mode register (smr) is an 8-bit register that specifies the sci serial communication format and selects the clock source for the baud rate generator. the cpu can always read and write to smr. smr is initialized to h'00 by a reset and in standby and module standby mode. .com .com .com .com 4 .com u datasheet
337 bit: 7 6 5 4 3 2 1 0 bit name: c / a chr pe o/ e stop mp cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bit 7?ommunication mode (c/ a ): selects whether the sci operates in asynchronous or clocked synchronous mode. bit 7: c/a description 0 asynchronous mode (initial value) 1 clocked synchronous mode ? bit 6?haracter length (chr): selects 7-bit or 8-bit data in asynchronous mode. in clocked synchronous mode, the data length is always eight bits, regardless of the chr setting. bit 6: chr description 0 8-bit data (initial value) 1 7-bit data. (when 7-bit data is selected, the msb (bit 7) of the transmit data register is not transmitted.) ? bit 5?arity enable (pe): selects whether to add a parity bit to transmit data and to check the parity of receive data, in asynchronous mode. in clocked synchronous mode, a parity bit is neither added nor checked, regardless of the pe setting. bit 5: pe description 0 parity bit not added or checked (initial value) 1 parity bit added and checked. when pe is set to 1, an even or odd parity bit is added to transmit data, depending on the parity mode (o/ e ) setting. receive data parity is checked according to the even/odd (o/ e ) mode setting. ? bit 4?arity mode (o/ e ): selects even or odd parity when parity bits are added and checked. the o/ e setting is used only in asynchronous mode and only when the parity enable bit (pe) is set to 1 to enable parity addition and checking. the o/ e setting is ignored in clocked synchronous mode, and in asynchronous mode when parity addition and checking is disabled. .com .com .com .com 4 .com u datasheet
338 bit 4: o/ e description 0 even parity (initial value) if even parity is selected, the parity bit is added to transmit data to make an even number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an even number of 1s in the received character and parity bit combined. 1 odd parity if odd parity is selected, the parity bit is added to transmit data to make an odd number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an odd number of 1s in the received character and parity bit combined. ? bit 3?top bit length (stop): selects one or two bits as the stop bit length in asynchronous mode. this setting is used only in asynchronous mode. it is ignored in clocked synchronous mode because no stop bits are added. ? in receiving, only the first stop bit is checked, regardless of the stop bit setting. if the second stop bit is 1, it is treated as a stop bit, but if the second stop bit is 0, it is treated as the start bit of the next incoming character. bit 3: stop description 0 one stop bit (initial value) in transmitting, a single 1-bit is added at the end of each transmitted character 1 two stop bits in transmitting, two 1-bits are added at the end of each transmitted character ? bit 2?ultiprocessor mode (mp): selects multiprocessor format. when multiprocessor format is selected, settings of the parity enable (pe) and parity mode (o/ e ) bits are ignored. the mp bit setting is used only in asynchronous mode; it is ignored in clocked synchronous mode. for the multiprocessor communication function, see section 13.3.3, multiprocessor communication. bit 2: mp description 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected .com .com .com .com 4 .com u datasheet
339 ? bits 1 and 0?lock select 1 and 0 (cks1 and cks0): these bits select the internal clock source of the built-in baud rate generator. four clock sources are available. /4, /16, /64 and /256. for further information on the clock source, bit rate register settings, and baud rate, see section 13.2.8, bit rate register. bit 1: cks1 bit 0: cks0 description 00 /4 (initial value) 1 /16 10 /64 1 /256 13.2.6 serial control register (scr) the serial control register (scr) operates the sci transmitter/receiver, selects the serial clock output in asynchronous mode, enables/disables interrupts, and selects the transmit/receive clock source. the cpu can always read and write to scr. scr is initialized to h'00 by a reset and in standby and module standby modes. bit: 7 6 5 4 3 2 1 0 bit name: tie rie te re mpie teie cke1 cke0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bit 7?ransmit interrupt enable (tie): enables or disables the transmit-data-empty interrupt (txi) requested when the transmit data register empty bit (tdre) in the serial status register (ssr) is set to 1 due to transfer of serial transmit data from tdr to tsr. bit 7: tie description 0 transmit-data-empty interrupt request (txi) is disabled (initial value) the txi interrupt request can be cleared by reading tdre after it has been set to 1, then clearing tdre to 0, or by clearing tie to 0. 1 transmit-data-empty interrupt request (txi) is enabled ? bit 6?eceive interrupt enable (rie): enables or disables the receive-data-full interrupt (rxi) requested when the receive data register full bit (rdrf) in the serial status register (ssr) is set to 1 due to transfer of serial receive data from rsr to rdr. it also enables or disables receive-error interrupt (eri) requests. .com .com .com .com 4 .com u datasheet
340 bit 6: rie description 0 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are disabled (initial value) rxi and eri interrupt requests can be cleared by reading the rdrf flag or error flag (fer, per, or orer) after it has been set to 1, then clearing the flag to 0, or by clearing rie to 0. 1 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are enabled ? bit 5?ransmit enable (te): enables or disables the sci serial transmitter. bit 5: te description 0 transmitter disabled (initial value) the transmit data register empty bit (tdre) in the serial status register (ssr) is locked at 1 1 transmitter enabled serial transmission starts when the transmit data register empty (tdre) bit in the serial status register (ssr) is cleared to 0 after writing of transmit data into tdr. select the transmit format in smr before setting te to 1. ? bit 4?eceive enable (re): enables or disables the sci serial receiver. bit 4: re description 0 receiver disabled (initial value) clearing re to 0 does not affect the receive flags (rdrf, fer, per, orer). these flags retain their previous values. 1 receiver enabled serial reception starts when a start bit is detected in asynchronous mode, or synchronous clock input is detected in clocked synchronous mode. select the receive format in smr before setting re to 1. ? bit 3?ultiprocessor interrupt enable (mpie): enables or disables multiprocessor interrupts. the mpie setting is used only in asynchronous mode, and only if the multiprocessor mode bit (mp) in the serial mode register (smr) is set to 1 during reception. the mpie setting is ignored in clocked synchronous mode or when the mp bit is cleared to 0. .com .com .com .com 4 .com u datasheet
341 bit 3: mpie description 0 multiprocessor interrupts are disabled (normal receive operation) (initial value) mpe is cleared to 0 when mpie is cleared to 0, or the multiprocessor bit (mpb) is set to 1 in receive data. 1 multiprocessor interrupts are enabled receive-data-full interrupt requests (rxi), receive-error interrupt requests (eri), and setting of the rdrf, fer, and orer status flags in the serial status register (ssr) are disabled until the multiprocessor bit is set to 1. the sci does not transfer receive data from rsr to rdr, does not detect receive errors, and does not set the rdrf, fer, and orer flags in the serial status register (ssr). when it receives data that includes mpb = 1, mpb is set to 1 in ssr, and the sci automatically clears mpie to 0, generates rxi and eri interrupts (if the tie and rie bits in scr are set to 1), and enables the fer and orer bits to be set. ? bit 2?ransmit-end iinterrupt enable (teie): enables or disables the transmit-end interrupt (tei) requested if tdr does not contain new transmit data when the msb is transmitted. bit 2: teie description 0 transmit-end interrupt (tei) requests are disabled* (initial value) 1 transmit-end interrupt (tei) requests are enabled* note: the tei request can be cleared by reading the tdre bit in the serial status register (ssr) after it has been set to 1, then clearing tdre to 0; by clearing the transmit end (tend) bit to 0; or by clearing the teie bit to 0. ? bits 1 and 0?lock enable 1 and 0 (cke1 and cke0): these bits select the sci clock source and enable or disable clock output from the sck pin. depending on the combination of cke1 and cke0, the sck pin can be used for general-purpose input/output, serial clock output, or serial clock input. the cke0 setting is valid only in asynchronous mode, and only when the sci is internally clocked (cke1 = 0). the cke0 setting is ignored in clocked synchronous mode, or when an external clock source is selected (cke1 = 1). select the sci operating mode in the serial mode register (smr) before setting cke1 and cke0. for further details on selection of the sci clock source, see table 13.9 in section 13.3, operation. .com .com .com .com 4 .com u datasheet
342 bit 1: cke1 bit 0: cke0 description 0 0 asynchronous mode internal clock, sck pin used for input pin (input signal is ignored or output pin output level is undefined) *1 clocked synchronous mode internal clock, sck pin used for synchronous clock output* 1 0 1 asynchronous mode internal clock, sck pin used for clock output* 2 clocked synchronous mode internal clock, sck pin used for synchronous clock output 1 0 asynchronous mode external clock, sck pin used for clock input* 3 clocked synchronous mode external clock, sck pin used for synchronous clock input 1 1 asynchronous mode external clock, sck pin used for clock input* 3 clocked synchronous mode external clock, sck pin used for synchronous clock input notes: 1. initial value 2. the output clock frequency is the same as the bit rate. 3. the input clock frequency is 16 times the bit rate. 13.2.7 serial status register (ssr) the serial status register (ssr) is an 8-bit register containing multiprocessor bit values, and status flags that indicate the sci operating status. the cpu can always read and write to ssr, but cannot write 1 in the status flags (tdre, rdrf, orer, per, and fer). these flags can be cleared to 0 only if they have first been read (after being set to 1). bits 2 (tend) and 1 (mpb) are read-only bits that cannot be written. ssr is initialized to h'84 by a reset and in standby and module standby mode. bit: 7 6 5 4 3 2 1 0 bit name: tdre rdrf orer fer per tend mpb mpbt initial value: 1 0 0 0 0 1 0 0 r/w: r/(w)* r/(w)* r/(w)* r/(w)* r/(w)* r r r/w note: the only value that can be written is a 0 to clear the flag. ? bit 7?ransmit data register empty (tdre): indicates that the sci has loaded transmit data from tdr into tsr and new serial transmit data can be written in tdr. .com .com .com .com 4 .com u datasheet
343 bit 7: tdre description 0 tdr contains valid transmit data tdre is cleared to 0 when software reads tdre after it has been set to 1, then writes 0 in tdre, or the dmac writes data in tdr. 1 tdr does not contain valid transmit data (initial value) tdre is set to 1 when the chip is reset or enters standby mode, the te bit in the serial control register (scr) is cleared to 0, or tdr contents are loaded into tsr, so new data can be written in tdr. ? bit 6?eceive data register full (rdrf): indicates that rdr contains received data. bit 6: rdrf description 0 rdr does not contain valid receive data (initial value) rdrf is cleared to 0 when the chip is reset or enters standby mode, software reads rdrf after it has been set to 1, then writes 0 in rdrf, or the dmac reads data from rdr. 1 rdr contains valid received data rdrf is set to 1 when serial data is received normally and transferred from rsr to rdr. note: rdr and rdrf are not affected by detection of receive errors or by clearing of the re bit to 0 in the serial control register. they retain their previous contents. if rdrf is still set to 1 when reception of the next data ends, an overrun error (orer) occurs and the received data is lost. ? bit 5?verrun error (orer): indicates that data reception ended abnormally due to an overrun error. bit 5: orer description 0 receiving is in progress or has ended normally *1 (initial value) orer is cleared to 0 when the chip is reset or enters standby mode, or software reads orer after it has been set to 1, then writes 0 in orer. 1 a receive overrun error occurred *2 orer is set to 1 if reception of the next serial data ends when rdrf is set to 1. notes: 1. clearing the re bit to 0 in the serial control register does not affect the orer bit, which retains its previous value. 2. rdr continues to hold the data received before the overrun error, so subsequent receive data is lost. serial receiving cannot continue while orer is set to 1. in clocked synchronous mode, serial transmitting is disabled. .com .com .com .com 4 .com u datasheet
344 ? bit 4?raming error (fer): indicates that data reception ended abnormally due to a framing error in asynchronous mode. bit 4: fer description 0 receiving is in progress or has ended normally (initial value) clearing the re bit to 0 in the serial control register does not affect the fer bit, which retains its previous value. fer is cleared to 0 when the chip is reset or enters standby mode, or software reads fer after it has been set to 1, then writes 0 in fer. 1 a receive framing error occurred when the stop bit length is two bits, only the first bit is checked. the second stop bit is not checked. when a framing error occurs, the sci transfers the receive data into rdr but does not set rdrf. serial receiving cannot continue while fer is set to 1. in clocked synchronous mode, serial transmitting is also disabled. fer is set to 1 if the stop bit at the end of receive data is checked and found to be 0. ? bit 3?arity error (per): indicates that data reception (with parity) ended abnormally due to a parity error in asynchronous mode. bit 3: per description 0 receiving is in progress or has ended normally (initial value) clearing the re bit to 0 in the serial control register does not affect the per bit, which retains its previous value. per is cleared to 0 when the chip is reset or enters standby mode, or software reads per after it has been set to 1, then writes 0 in per. 1 a receive parity error occurred when a parity error occurs, the sci transfers the receive data into rdr but does not rdrf. serial receiving cannot continue while per is set to 1. in clocked synchronous mode, serial transmitting is also disabled. per is set to 1 if the number of 1s in receive data, including the parity bit, does not match the even or odd parity setting of the parity mode bit (o/ e ) in the serial mode register (smr). .com .com .com .com 4 .com u datasheet
345 ? bit 2?ransmit end (tend): indicates that when the last bit of a serial character was transmitted, tdr did not contain valid data, so transmission has ended. tend is a read-only bit and cannot be written. bit 2: tend description 0 transmission is in progress tend is cleared to 0 when software reads tdre after it has been set to 1, then writes 0 in tdre, or the dmac writes data in tdr. 1 end of transmission (initial value) tend is set to 1 when the chip is reset or enters standby mode, te is cleared to 0 in the serial control register (scr), or tdre is 1 when the last bit of a one-byte serial character is transmitted. ? bit 1?ultiprocessor bit (mpb): stores the value of the multiprocessor bit in receive data when a multiprocessor format is selected for receiving in asynchronous mode. mpb is a read- only bit and cannot be written. bit 1: mpb description 0 multiprocessor bit value in receive data is 0 (initial value) if re is cleared to 0 when a multiprocessor format is selected, mpb retains its previous value. 1 multiprocessor bit value in receive data is 1 ? bit 0?ultiprocessor bit transfer (mpbt): stores the value of the multiprocessor bit added to transmit data when a multiprocessor format is selected for transmitting in asynchronous mode. the mpbt setting is ignored in clocked synchronous mode, when a multiprocessor format is not selected, or when the sci is not transmitting. bit 0: mpbt description 0 multiprocessor bit value in transmit data is 0 (initial value) 1 multiprocessor bit value in transmit data is 1 .com .com .com .com 4 .com u datasheet
346 13.2.8 bit rate register (brr) the bit rate register (brr) is an 8-bit register that, together with the baud rate generator clock source selected by the cks1 and cks0 bits in the serial mode register (smr), determines the serial transmit/receive bit rate. the cpu can always read and write to brr. brr is initialized to h'ff by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 13.3 shows examples of brr settings in asynchronous mode; table 13.4 shows examples of bbr settings in clocked synchronous mode. .com .com .com .com 4 .com u datasheet
347 table 13.3 bit rates and brr settings in asynchronous mode (mhz) 4 4.9152 8 9.8304 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 1 70 0.03 1 86 0.31 1 141 0.03 1 174 ?.26 150 0 207 0.16 0 255 0.00 1 103 0.16 1 127 0.00 300 0 103 0.16 0 127 0.00 0 207 0.16 0 255 0.00 600 0 51 0.16 0 63 0.00 0 103 0.16 0 127 0.00 1200 0 25 0.16 0 31 0.00 0 51 0.16 0 63 0.00 2400 0 12 0.16 0 15 0.00 0 25 0.16 0 31 0.00 4800 0 7 0.00 0 12 0.16 0 15 0.00 9600 0 3 0.00 0 7 0.00 19200 0 1 0.00 0 3 0.00 31250 0 0 0.00 0 1 0.00 38400 0 0 0.00 0 1 0.00 (mhz) 12 14.7456 16 19.6608 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 1 212 0.03 2 64 0.70 2 70 0.03 2 86 0.31 150 1 155 0.16 1 191 0.00 1 207 0.16 1 255 0.00 300 1 77 0.16 1 95 0.00 1 103 0.16 1 127 0.00 600 0 155 0.16 0 191 0.00 0 207 0.16 0 255 0.00 1200 0 77 0.16 0 95 0.00 0 103 0.16 0 127 0.00 2400 0 38 0.16 0 47 0.00 0 51 0.16 0 63 0.00 4800 0 19 ?.34 0 23 0.00 0 25 0.16 0 31 0.00 9600 0 9 ?.34 0 11 0.00 0 12 0.16 0 15 0.00 19200 0 4 ?.34 0 5 0.00 0 7 0.00 31250 0 2 0.00 0 3 0.00 0 4 ?.70 38400 0 2 0.00 0 3 0.00 .com .com .com .com 4 .com u datasheet
348 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 20 24 24.576 28.7 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 88 ?.25 2 106 ?.44 2 108 0.08 2 126 0.31 150 2 64 0.16 2 77 0.16 2 79 0.00 2 92 0.46 300 1 129 0.16 1 155 0.16 1 159 0.00 1 186 -0.08 600 1 64 0.16 1 77 0.16 1 79 0.00 1 92 0.46 1200 0 129 0.16 0 155 0.16 0 159 0.00 0 186 -0.08 2400 0 64 0.16 0 77 0.16 0 79 0.00 0 92 0.46 4800 0 32 ?.36 0 38 0.16 0 39 0.00 0 46 -0.61 9600 0 15 1.73 0 19 ?.34 0 19 0.00 0 22 1.55 19200 0 7 1.73 0 9 ?.34 0 9 0.00 0 11 -2.68 31250 0 4 0.00 0 5 0.00 0 5 2.40 0 6 2.50 38400 0 3 1.73 0 4 ?.34 0 4 0.00 0 5 -2.68 .com .com .com .com 4 .com u datasheet
349 table 13.4 bit rates and brr settings in clocked synchronous mode (mhz) bit rate 4 8 16 28.7 (bits/s) n n n n n n n n 110 2 141 3 70 3 141 3 254 250 1 249 2 124 2 249 3 111 500 1 124 1 249 2 124 2 223 1k 0 249 1 124 1 249 2 111 2.5k 0 99 0 199 1 99 1 178 5k 0 49 0 99 0 199 1 89 10k 0 24 0 49 0 99 0 178 25k 09019039071 50k 0409019035 100k 0409017 250k 0 0* 0103 500k 0 0* 0 1 1m 0 0* note: settings with an error of 1% or less are recommended. explanation of symbols: blank: no setting possible ? setting possible, but error occurs *: continuous transmission/reception not possible the brr setting is calculated as follows: asynchronous mode: n = 256 2 2n 1 b 10 6 ?1 clocked synchronous mode: n = 32 2 2n 1 b 10 6 ?1 b: bit rate (bit/s) n: brr setting for baud rate generator (0 n 255) f: operating frequency (mhz) n: baud rate generator clock source (n = 0, 1, 2, 3) (for the clock sources and values of n, see table 13.6.) .com .com .com .com 4 .com u datasheet
350 table 13.5 smr settings smr settings n clock source cks1 cks0 0 /4 0 0 1 /16 0 1 2 /164 1 0 3 /256 1 1 the bit rate error for asynchronous mode is given by the following equation: error (%) = 10 6 (n + 1) b 256 2 2n 1 ?1 ? ? ? ? ? ? 100 table 13.6 shows the maximum bit rates in asynchronous mode when the baud rate generator is being used. tables 13.7 and 13.8 show the maximum rates for external clock input. table 13.6 maximum bit rates for various frequencies with baud rate generator (asynchronous mode) settings (mhz) maximum bit rate (bits/s) n n 4 31250 0 0 4.9152 38400 0 0 8 62500 0 0 9.8304 76800 0 0 12 93750 0 0 14.7456 115200 0 0 16 125000 0 0 19.6608 153600 0 0 20 156250 0 0 24 187500 0 0 24.576 192000 0 0 28.7 224218 0 0 .com .com .com .com 4 .com u datasheet
351 table 13.7 maximum bit rates with external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 4 0.2500 15625 4.9152 0.3072 19200 8 0.5000 31250 9.8304 0.6144 38400 12 0.7500 46875 14.7456 0.9216 57600 16 1.0000 62500 19.6608 1.2288 76800 20 1.2500 78125 24 1.5000 93750 24.576 1.5360 96000 28.7 1.79375 112109 table 13.8 maximum bit rates with external clock input (clocked synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 8 0.3333 333333.3 16 0.6667 666666.7 24 1.0000 1000000.0 28.7 1.1958 1195833.3 .com .com .com .com 4 .com u datasheet
352 13.3 operation 13.3.1 overview for serial communication, the sci has an asynchronous mode in which characters are synchronized individually, and a clocked synchronous mode in which communication is synchronized with clock pulses. asynchronous/clocked synchronous mode and the communication format are selected in the serial mode register (smr), as shown in table 13.9. the sci clock source is selected by the c/ a bit in the serial mode register (smr) and the cke1 and cke0 bits in the serial control register (scr), as shown in table 13.10. asynchronous mode: ? data length is selectable. seven or eight bits. ? parity and multiprocessor bits are selectable, as is the stop bit length (one or two bits). the preceding selections constitute the communication format and character length. ? in receiving, it is possible to detect framing errors, parity errors, overrun errors, and the break state. ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the built-in baud rate generator, and can output a serial clock signal with a frequency matching the bit rate. ? when an external clock is selected, the external clock input must have a frequency 16 times the bit rate. (the built-in baud rate generator is not used.) clocked synchronous mode: ? the communication format has a fixed eight-bit data length. ? in receiving, it is possible to detect overrun errors. ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the built-in baud rate generator, and outputs a synchronous clock signal to external devices. ? when an external clock is selected, the sci operates on the input synchronous clock. the built-in baud rate generator is not used. .com .com .com .com 4 .com u datasheet
353 table 13.9 serial mode register settings and sci communication formats smr settings sci communication format mode bit 7 c/a bit 6 chr bit 5 pe bit 2 mp bit 3 stop data length parity bit multipro- cessor bit stop bit length asynchronous 0 0000 8-bit not set not set 1 bit 1 2 bits 1 0 set 1 bit 1 2 bits 1 0 0 7-bit not set 1 bit 1 2 bits 1 0 set 1 bit 1 2 bits asynchronous 0 0 * 1 0 8-bit not set set 1 bit (multiprocessor * 1 2 bits format) 1 * 0 7-bit 1 bit * 1 2 bits clocked synchronous 1**** 8-bit not set not set none note: asterisks (*) in the table indicate don? care bits. table 13.10 smr and scr settings and sci clock source selection smr scr settings sci transmit/receive clock mode bit 7 c/ a bit 1 cke1 bit 0 cke0 clock source sck pin function asynchronous 0 0 0 internal sci does not use the sck pin 1 outputs a clock with frequency matching the bit rate 1 0 external inputs a clock with frequency 16 times the bit rate 1 clocked synch- 1 0 0 internal outputs the synchronous clock ronous 1 1 0 external inputs the synchronous clock 1 .com .com .com .com 4 .com u datasheet
354 13.3.2 operation in asynchronous mode in asynchronous mode, each transmitted or received character begins with a start bit and ends with a stop bit. serial communication is synchronized one character at a time. the transmitting and receiving sections of the sci are independent, so full duplex communication is possible. the transmitter and receiver are both double buffered, so data can be written and read while transmitting and receiving are in progress, enabling continuous transmitting and receiving. figure 13.2 shows the general format of asynchronous serial communication. in asynchronous serial communication, the communication line is normally held in the mark (high) state. the sci monitors the line and starts serial communication when the line goes to the space (low) state, indicating a start bit. one serial character consists of a start bit (low), data (lsb first), parity bit (high or low), and stop bit (high), in that order. when receiving in asynchronous mode, the sci synchronizes on the falling edge of the start bit. the sci samples each data bit on the eighth pulse of a clock with a frequency 16 times the bit rate. receive data is latched at the center of each bit. 0d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 1 1 0/1 1 1 (lsb) (msb) serial data state bit 1 bit transmit/receive data 7 or 8 bits one unit of communication data (character or frame) idle (mark) state parity bit stop bit 1 or no bit 1 or 2 bits figure 13.2 example of data format in asynchronous communication (8-bit data with parity and two stop bits) .com .com .com .com 4 .com u datasheet
355 transmit/receive formats. table 13.11 shows the 12 communication formats that can be selected in asynchronous mode. the format is selected by settings in the serial mode register (smr). table 13.11 serial communication formats (asynchronous mode) smr bits serial transmit/receive format and frame length chr pe mp stop 1 2345678 9 10 11 12 0 0 0 0 start 8-bit data stop 0 0 0 1 start 8-bit data stop stop 0 1 0 0 start 8-bit data p stop 0 1 0 1 start 8-bit data p stop stop 1 0 0 0 start 7-bit data stop 1 0 0 1 start 7-bit data stop stop 1 1 0 0 start 7-bit data p stop 1 1 0 1 start 7-bit data p stop stop 0 1 0 start 8-bit data mpb stop 0 1 1 start 8-bit data mpb stop stop 1 1 0 start 7-bit data mpb stop 1 1 1 start 7-bit data mpb stop stop : don t care bits. start: start bit stop: stop bit p: parity bit mpb: multiprocessor bit .com .com .com .com 4 .com u datasheet
356 clock: an internal clock generated by the built-in baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr) (table 13.9). when an external clock is input at the sck pin, it must have a frequency equal to 16 times the desired bit rate. when the sci operates on an internal clock, it can output a clock signal at the sck pin. the frequency of this output clock is equal to the bit rate. the phase is aligned as in figure 13.3 so that the rising edge of the clock occurs at the center of each transmit data bit. 0 d0d1d2d3d4d5d6d70/1 1 1 1 frame figure 13.3 output clock and serial data timing (asynchronous mode) transmitting and receiving data sci initialization (asynchronous mode): before transmitting or receiving, clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the operation mode or communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. when an external clock is used, the clock should not be stopped during initialization or subsequent operation. sci operation becomes unreliable if the clock is stopped. figure 13.4 shows a sample flowchart for initializing the sci. the procedure for initializing the sci is as follows: 1. select the communication format in the serial mode register (smr). 2. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. 3. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te and re cleared to 0. if clock output is selected in asynchronous mode, clock output starts immediately after the setting is made in scr. .com .com .com .com 4 .com u datasheet
357 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. also set rie, tie, teie and mpie as necessary. setting te or re enables the sci to use the txd or rxd pin. the initial states are the mark state when transmitting, and the idle state when receiving (waiting for a start bit). initialization clear te and re bits in scr to 0 select transmit/receive format in smr set value in brr set cke1 and cke0 bits in scr (te and re bits are 0) wait set te and re bits in scr to 1 and set rie, teie, and mpie bits has a 1-bit interval elapsed? end 1 3 4 no yes 2 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.4 sample flowchart for sci initialization .com .com .com .com 4 .com u datasheet
358 transmitting serial data (asynchronous mode): figure 13.5 shows a sample flowchart for transmitting serial data. the procedure for transmitting serial data is as follows: 1. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. 2. to continue transmitting serial data, read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data-empty interrupt request (txi) in order to write data in tdr, the tdre bit is checked and cleared automatically. start transmission read tdre bit in ssr read tend bit in ssr tend = 1? end transmission no yes tdre = 1? write transmit data to tdr and clear tdre bit in ssr to 0 all data transmitted? no yes yes no 1 2 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.5 sample flowchart for transmitting serial data .com .com .com .com 4 .com u datasheet
359 in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0, the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) is set to 1 in scr, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin: a. start bit: one 0-bit is output. b. transmit data: seven or eight bits of data are output, lsb first. c. parity bit or multiprocessor bit: one parity bit (even or odd parity) or one multiprocessor bit is output. formats in which neither a parity bit nor a multiprocessor bit is output can also be selected. d. stop bit: one or two 1-bits (stop bits) are output. e. mark state: output of 1-bits continues until the start bit of the next transmit data. 3. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads new data from tdr into tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit to 1 in ssr, outputs the stop bit, then continues output of 1-bits (mark state). if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested. figure 13.6 shows an example of sci transmit operation in asynchronous mode. .com .com .com .com 4 .com u datasheet
360 01 1 1 0/1 0 1 tdre tend parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (mark) state txi interrupt request generated txi interrupt request generated tei interrupt request generated txi interrupt handler writes data to tdr and clears tdre bit to 0 1 frame d 0 d 1 d 7 d 0 d 1 d 7 0/1 example: 8-bit data with parity and one stop bit figure 13.6 example of sci transmit operation in asynchronous mode (8-bit data with parity and one stop bit) receiving serial data (asynchronous mode): figure 13.7 shows a sample flowchart for receiving serial data. the procedure for receiving serial data is as follows: 1. receive error handling: if a receive error occurs, read the orer, per and fer bits of the ssr to identify the error. after executing the necessary error handling, clear orer, per and fer all to 0. receiving cannot resume if orer, per or fer remain set to 1. 2. sci status check and receive-data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 3. to continue receiving serial data: read the rdrf and rdr bits and clear rdrf to 0 before the stop bit of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically so this step is unnecessary. .com .com .com .com 4 .com u datasheet
361 start reception read orer, per, and fer bits in ssr all data received? end reception no yes per, fer, orer = 1? rdrf = 1? yes yes clear re bit in scr to 0 no no read rdrf bit in ssr error handling read receive data in rdr, and clear rdrf bit in ssr to 0 1 2 3 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.7 sample flowchart for receiving serial data .com .com .com .com 4 .com u datasheet
362 error handling orer = 1? overrun error handling fer = 1? yes framing error handling per = 1? yes parity error handling clear orer, per, and fer bits in ssr to 0 end no no no yes note: circled numbers refer to the preceding description of the procedure in the text. figure 13.7 sample flowchart for receiving serial data (cont) .com .com .com .com 4 .com u datasheet
363 in receiving, the sci operates as follows: 1. the sci monitors the receive data line. when it detects a start bit (0), the sci synchronizes internally and starts receiving. 2. receive data is shifted into rsr in order from lsb to msb. 3. the parity bit and stop bit are received. after receiving these bits, the sci makes the following checks: a. parity check: the number of 1s in the receive data must match the even or odd parity setting of the o/ e bit in smr. b. stop bit check: the stop bit value must be 1. if there are two stop bits, only the first stop bit is checked. c. status check: rdrf must be 0 so that receive data can be loaded from rsr into rdr. if these checks all pass, the sci sets rdrf to 1 and stores the received data in rdr. if one of the checks fails (receive error), the sci operates as indicated in table 13.11. note: when a receive error flag is set, further receiving is disabled. in reception, the rdrf bit is not set to 1. be sure to clear the error flags. 4. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in scr, the sci requests a receive-data-full interrupt (rxi). if one of the error flags (orer, per, or fer) is set to 1 and the receive-data-full interrupt enable bit (rie) in scr is also set to 1, the sci requests a receive-error interrupt (eri). figure 13.8 shows an example of sci receive operation in asynchronous mode. table 13.12 receive error conditions and sci operation receive error abbreviation condition data transfer overrun error orer receiving of next data ends while rdrf is still set to 1 in ssr receive data not loaded from rsr into rdr framing error fer stop bit is 0 receive data loaded from rsr into rdr parity error per parity of receive data differs from even/odd parity setting in smr receive data loaded from rsr into rdr .com .com .com .com 4 .com u datasheet
364 tdre fer eri interrupt request generated by framing error 1 frame rxi interrupt handler reads data and clears rdrf bit to 0 rxi interrupt request generated 01 1 1 0/1 0 0 parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0/1 figure 13.8 example of sci receive operation (8-bit data with parity and one stop bit) 13.3.3 multiprocessor communication the multiprocessor communication function enables several processors to share a single serial communication line. the processors communicate in asynchronous mode using a format with an additional multiprocessor bit (multiprocessor format). in multiprocessor communication, each receiving processor is addressed by a unique id. a serial communication cycle consists of an id-sending cycle that identifies the receiving processor, and a data-sending cycle. the multiprocessor bit distinguishes id-sending cycles from data-sending cycles. the transmitting processor starts by sending the id of the receiving processor with which it wants to communicate as data with the multiprocessor bit set to 1. next, the transmitting processor sends transmit data with the multiprocessor bit cleared to 0. receiving processors skip incoming data until they receive data with the multiprocessor bit set to 1. when they receive data with the multiprocessor bit set to 1, receiving processors compare the data with their ids. the receiving processor with a matching id continues to receive further incoming data. processors with ids not matching the received data skip further incoming data until they again receive data with the multiprocessor bit set to 1. multiple processors can send and receive data in this way. figure 13.9 shows an example of communication among processors using the multiprocessor format. .com .com .com .com 4 .com u datasheet
365 receiving processor a (id = 01) (id = 02) (id = 03) (id = 04) receiving processor b receiving processor c serial communication line h'01 h'aa (mpb = 0) (mpb = 1) id transmit cycle = receiving station specification serial data transmitting processor receiving processor d data transmit cycle = data transmission to receiving station specified by id mpb: multiprocessor bit figure 13.9 example of communication among processors using multiprocessor format (sending data h'aa to receiving processor a) communication formats: four formats are available. parity-bit settings are ignored when the multiprocessor format is selected. for details see table 13.8. clock: see the description in the asynchronous mode section. transmitting multiprocessor serial data: figure 13.10 shows a sample flowchart for transmitting multiprocessor serial data. the procedure for transmitting multiprocessor serial data is as follows: 1. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr). also set the mpbt (multiprocessor bit transfer) bit to 0 or 1 in ssr. finally, clear tdre to 0. 2. to continue transmitting serial data, read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. .com .com .com .com 4 .com u datasheet
366 tdre = 1? write transmit data to tdr and set mpbt bit in ssr transmission ended? yes tend = 1? read tend bit in ssr yes end transmission yes read tdre bit in ssr clear tdre bit to 0 no no no start transmission 1 2 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.10 sample flowchart for transmitting multiprocessor serial data in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin: a. start bit: one 0 bit is output. b. transmit data: seven or eight bits are output, lsb first. c. multiprocessor bit: one multiprocessor bit (mpbt value) is output. d. stop bit: one or two 1-bits (stop bits) are output. e. mark state: output of 1-bits continues until the start bit of the next transmit data. .com .com .com .com 4 .com u datasheet
367 3. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads data from tdr into tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in ssr to 1, outputs the stop bit, then continues output of 1-bits in the mark state. if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested at this time. tdre tend txi interrupt request generated txi interrupt request generated tei interrupt request generated txi interrupt handler writes data to tdr and clears tdre bit to 0 1 frame 01 1 1 0/1 0 1 multi- processor bit serial data start bit data stop bit start bit data stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0/1 multi- processor bit figure 13.11 example of sci multiprocessor transmit operation (8-bit data with multiprocessor bit and one stop bit) receiving multiprocessor serial data: figure 13.12 shows a sample flowchart for receiving multiprocessor serial data. the procedure for receiving multiprocessor serial data is as follows. 1. id receive cycle: set the mpie bit in the serial control register (scr) to 1. 2. sci status check, id reception and comparison: read the serial status register (ssr), check that rdrf is set to 1, then read data from the receive data register (rdr) and compare with the processor? own id. if the id does not match the receive data, set mpie to 1 again and clear rdrf to 0. if the id matches the receive data, clear rdrf to 0. 3. receive error handling: if a receive error occurs (figure 13.12 (cont)), read the orer and fer bits in ssr to identify the error. after executing the necessary error handling, clear both orer and fer to 0. receiving cannot resume if orer or fer remains set to 1. when a framing error occurs, the rxd pin can be read to detect the break state. 4. sci status check and data receiving: read ssr, check that rdrf is set to 1, then read data from the receive data register (rdr). .com .com .com .com 4 .com u datasheet
368 rdrf = 1? fer = 1 or orer = 1? rdrf = 1? all data received? no end reception yes set mpie bit in scr to 1 read rdrf bit in ssr clear re bit in scr to 0 no no read orer and fer bits in ssr fer = 1 or orer = 1? read rdrf bit in ssr read receive data in rdr is id this processor s id? yes read orer and fer bits in ssr no error handling yes yes yes no start reception no yes read receive data in rdr 1 2 4 3 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.12 sample flowchart for receiving multiprocessor serial data .com .com .com .com 4 .com u datasheet
369 orer = 1? yes framing error handling yes error handling overrun error handling fer = 1? clear orer and fer bits in ssr to 0 end no no figure 13.12 sample flowchart for receiving multiprocessor serial data (cont) .com .com .com .com 4 .com u datasheet
370 figure 13.13 shows an example of sci receive operation using a multiprocessor format. rdrf mpie rdr value id1 rxi interrupt request (multiprocessor interrupt) generated, mpie = 0 rxi interrupt handler reads rdr data and clears rdrf bit to 0 id is not this processor s id, so mpie bit is set to 1 again no rxi interrupt generated; rdr state is held 01 1 1 10 1 stop bit mpb serial data start bit data (id1) data (data 1) start bit mpb stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0 mpb figure 13.13 example of sci receive operation (own id does not match data, 8-bit data with multiprocessor bit and one stop bit) .com .com .com .com 4 .com u datasheet
371 rdrf mpie rdr value id1 id2 data2 01 1 1 10 1 mpb mpb serial data start bit data (id2) data (data 2) stop bit start bit stop bit idling (marking) d 0 d 1 d 7 d 0 d 1 d 7 0 rxi interrupt request (multiprocessor interrupt) generated, mpie = 0 rxi interrupt handler reads rdr data and clears rdrf bit to 0 id is that of this processor, so reception continues unchanged and data is received by the rxi interrupt handler mpie bit set to 1 again mpb figure 13.13 example of sci receive operation (own id matches data, 8-bit data with multiprocessor bit and one stop bit) (cont) 13.3.4 clocked synchronous operation in clocked synchronous mode, the sci transmits and receives data in synchronization with clock pulses. this mode is suitable for high-speed serial communication. the sci transmitter and receiver are independent, so full duplex communication is possible while sharing the same clock. the transmitter and receiver are also double buffered, so continuous transmitting or receiving is possible by reading or writing data while transmitting or receiving is in progress. figure 13.14 shows the general format in clocked synchronous serial communication. .com .com .com .com 4 .com u datasheet
372 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 lsb msb serial clock serial data ** transfer direction one unit of communication data (character or frame) note: high except in continuous transmitting or receiving. figure 13.14 data format in clocked synchronous communication in clocked synchronous serial communication, each data bit is output on the communication line from one falling edge of the serial clock to the next. data is guaranteed valid at the rising edge of the serial clock. in each character, the serial data bits are transmitted in order from lsb (first) to msb (last). after output of the msb, the communication line remains in the state of the msb. in clocked synchronous mode, the sci transmits or receives data by synchronizing with the falling edge of the serial clock. communication format: the data length is fixed at eight bits. no parity bit or multiprocessor bit can be added. clock: an internal clock generated by the built-in baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr). see table 13.9. when the sci operates on an internal clock, it outputs the clock signal at the sck pin. eight clock pulses are output per transmitted or received character. when the sci is not transmitting or receiving, the clock signal remains in the high state. figure 13.15 shows an example of sci transmit operation. in transmitting serial data, the sci operates as follows. 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time. if clock output mode is selected, the sci outputs eight synchronous clock pulses. if an external clock source is selected, the sci outputs data in synchronization with the input clock. data is output from the txd pin in order from lsb (bit 0) to msb (bit 7). .com .com .com .com 4 .com u datasheet
373 3. the sci checks the tdre bit when it outputs the msb (bit 7). if tdre is 0, the sci loads data from tdr into tsr, transmits the msb, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in ssr to 1, transmits the msb, then holds the transmit data pin (txd) in the msb state. if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested at this time. 4. after the end of serial transmission, the sck pin is held in the high state. bit 0 bit 1 bit 7 bit 0 bit 1 bit 6 serial clock serial data transfer direction bit 7 txi interrupt handler writes data to tdr and clears tdre bit to 0 1 frame tdre tend lsb msb txi interrupt request generated txi interrupt request generated tei interrupt request generated figure 13.15 example of sci transmit operation transmitting and receiving data sci initialization (clocked synchronous mode): before transmitting or receiving, software must clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the mode or communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. figure 13.16 shows a sample flowchart for initializing the sci. the procedure for initializing the sci is as follows. 1. select the communication format in the serial mode register (smr). 2. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. .com .com .com .com 4 .com u datasheet
374 3. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te and re cleared to 0. 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. also set rie, tie, teie and mpie. initialization clear te and re bits in scr to 0 has a 1-bit period elapsed? set te and re bits in scr to 1 and set rie, tie, teie, and mpie bits set transmit/receive format in smr yes no set value in brr set rie, tie, teie, mpie, cke1, and cke0 bits in scr (te and re are 0) end wait 1 2 3 4 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.16 sample flowchart for sci initialization transmitting serial data (clocked synchronous mode): figure 13.17 shows a sample flowchart for transmitting serial data. the procedure for transmitting serial data is as follows. 1. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. 2. to continue transmitting serial data, read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. .com .com .com .com 4 .com u datasheet
375 start transmission read tdre bit in ssr all data transmitted? yes no end transmission tdre = 1? write transmssion data to tdr and clear tdre bit in ssr to 0 yes no read tend bit in ssr tend = 1? yes no clear te bit in scr to 0 1 2 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.17 sample flowchart for serial transmitting receiving serial data (clocked synchronous mode): figure 13.18 shows a sample flowchart for receiving serial data. when switching from asynchronous mode to clocked synchronous mode, make sure that orer, per, and fer are cleared to 0. if per or fer is set to 1, the rdrf bit will not be set and both transmitting and receiving will be disabled. figure 13.19 shows an example of the sci receive operation. the procedure for receiving serial data is as follows: 1. receive error handling: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error handling, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. .com .com .com .com 4 .com u datasheet
376 2. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 3. to continue receiving serial data: read rdr, and clear rdrf to 0 before the msb (bit 7) of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically so this step is unnecessary. read orer bit in ssr all data received? end reception no yes orer = 1? rdrf = 1? yes clear re bit in scr to 0 no no read rdrf bit in ssr yes error processing read receive data in rdr and clear rdrf bit in ssr to 0 start reception 1 2 3 note: circled numbers refer to the preceding description of the procedure in the text. figure 13.18 sample flowchart for serial receiving .com .com .com .com 4 .com u datasheet
377 error handling end orer = 1? no clear orer bit in ssr to 0 yes overrun error handling figure 13.18 sample flowchart for serial receiving (cont) bit 7 bit 0 bit 7 bit 0 bit 1 bit 6 serial clock serial data transfer direction bit 7 rxi interrupt handler reads data and clears rdrf bit to 0 1 frame rxi interrupt request generated rxi interrupt request generated eri interrupt request generated by overrun error rdrf orer figure 13.19 example of sci receive operation .com .com .com .com 4 .com u datasheet
378 in receiving, the sci operates as follows: 1. the sci synchronizes with serial clock input or output and initializes internally. 2. receive data is shifted into rsr in order from lsb to msb. after receiving the data, the sci checks that rdrf is 0 so that receive data can be loaded from rsr into rdr. if this check passes, the sci sets rdrf to 1 and stores the received data in rdr. if the check does not pass (receive error), the sci operates as indicated in table 13.8. the rdrf bit is not set to 1. be sure to clear the error flag. 3. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in scr, the sci requests a receive-data-full interrupt (rxi). if the orer bit is set to 1 and the receive- data-full interrupt enable bit (rie) in scr is also set to 1, the sci requests a receive-error interrupt (eri). transmitting and receiving serial data simultaneously (clocked synchronous mode): figure 13.20 shows a sample flowchart for transmitting and receiving serial data simultaneously. the procedure for transmitting and receiving serial data simultaneously is as follows: 1. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. the txi interrupt can also be used to determine if the tdre bit has changed from 0 to 1. 2. receive error handling: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error handling, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. 3. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 4. to continue transmitting and receiving serial data: read the rdrf bit and rdr, and clear rdrf to 0 before the msb (bit 7) of the current frame is received. also read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0 before the msb (bit 7) of the current frame is transmitted. when the dmac is started by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. when the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically. .com .com .com .com 4 .com u datasheet
379 start transmission/reception read tdre bit in ssr all data transmitted/received? end transmission/reception no yes tdre = 1? write transmit data to tdr and clear tdre bit in ssr to 0 rdrf = 1? no yes yes no read orer bit in ssr error handling orer = 1? no read rdrf bit in ssr yes read receive data in rdr and clear rdrf bit in ssr to 0 clear te and re bits in scr to 0 1 2 3 4 note: when switching from transmitting or receiving to simultaneous transmitting and receiving, clear both te and re to 0, then set both te and re to 1. circled numbers refer to the preceding description of the procedure in the text. figure 13.20 sample flowchart for serial transmitting .com .com .com .com 4 .com u datasheet
380 13.4 sci interrupt sources and the dmac the sci has four interrupt sources in each channel: transmit-end (tei), receive-error (eri), receive-data-full (rxi), and transmit-data-empty (txi). table 13.13 lists the interrupt sources and indicates their priority. these interrupts can be enabled and disabled by the tie, rie, and teie bits in the serial control register (scr). each interrupt request is sent separately to the interrupt controller. txi is requested when the tdre bit in ssr is set to 1. txi can start the direct memory access controller (dmac) to transfer data. tdre is automatically cleared to 0 when the dmac writes data in the transmit data register (tdr). rxi is requested when the rdrf bit in ssr is set to 1. rxi can start the dmac to transfer data. rdrf is automatically cleared to 0 when the dmac reads the receive data register (rdr). eri is requested when the orer, per, or fer bit in ssr is set to 1. eri cannot start the dmac. tei is requested when the tend bit in ssr is set to 1. tei cannot start the dmac. where the txi interrupt indicates that transmit data writing is enabled, the tei interrupt indicates that the transmit operation is complete. table 13.13 sci interrupt sources interrupt source description dmac availability priority eri receive error (orer, per, or fer) no high rxi receive data register full (rdrf) yes see section 4, exception handling, for information on the priority order and relationship to non- sci interrupts. 13.5 usage notes note the following points when using the sci. tdr write and tdre flag: the tdre bit in the serial status register (ssr) is a status flag indicating loading of transmit data from tdr into tsr. the sci sets tdre to 1 when it transfers data from tdr to tsr. data can be written to tdr regardless of the tdre bit status. if new data is written in tdr when tdre is 0, however, the old data stored in tdr will be lost because the data has not yet been transferred to tsr. before writing transmit data to tdr, be sure to check that tdre is set to 1. .com .com .com .com 4 .com u datasheet
381 simultaneous multiple receive errors: table 13.14 indicates the state of the ssr status flags when multiple receive errors occur simultaneously. when an overrun error occurs, the rsr contents cannot be transferred to rdr, so receive data is lost. table 13.14 ssr status flags and transfer of receive data ssr status flags receive data transfer receive error status rdrf orer fer per rsr rdr overrun error 1 1 0 0 x framing error 0 0 1 0 o parity error 0 0 0 1 o overrun error + framing error 1 1 1 0 x overrun error + parity error 1 1 0 1 x framing error + parity error 0 0 1 1 o overrun error + framing error + parity error 1111x o: receive data is transferred from rsr to rdr. x: receive data is not transferred from rsr to rdr. break detection and processing: in the break state, the input from the rxd pin consists of all 0s, so fer is set and the parity error flag (per) may also be set. in the break state, the sci receiver continues to operate, so if the fer bit is cleared to 0, it will be set to 1 again. receive error flags and transmitter operation (clocked synchronous mode only): when a receive error flag (orer, per, or fer) is set to 1, the sci will not start transmitting even if tdre is set to 1. be sure to clear the receive error flags to 0 before starting to transmit. note that clearing re to 0 does not clear the receive error flags. receive data sampling timing and receive margin in asynchronous mode: in asynchronous mode, the sci operates on a base clock of 16 times the bit rate frequency. in receiving, the sci synchronizes internally with the falling edge of the start bit, which it samples on the base clock. receive data is latched on the rising edge of the eighth base clock pulse. see figure 13.21. .com .com .com .com 4 .com u datasheet
382 0 1 2 3 4 5 6 7 8 9 10111213 1415 0 1 2 3 4 5 6 7 8 9 10111213 1415 0 1 2 3 4 5 clk receive data (rxd) synchronization sampling timing data sampling timing 8 clocks 16 clocks start bit 7.5 clocks +7.5 clocks d0 d1 figure 13.21 receive data sampling timing in asynchronous mode the receive margin in asynchronous mode can therefore be expressed as in equation 1. equation 1: m = 0. 5 1 2n 1 ? ? ? ? ? ? l 0. 5 ( ) d 0. 5 n (1 + f) 1.0) l : frame length (l = 9 12) f : absolute deviation of clock frequency from equation (1), if f = 0 and d = 0.5 the receive margin is 46.875%, as given by equation 2. equation 2: d = 0.5, f = 0 m = (0.5 1/(2 this is a theoretical value. a reasonable margin to allow in system designs is 20?0%. .com .com .com .com 4 .com u datasheet
383 constraints on dmac use: ? when using an external clock source for the serial clock, update tdr with the dmac, and then after twenty system clock cycles or more elapse, input a transmit clock. if a transmit clock is input in the first four states after tdr is written, an error may occur (figure 13.22). ? before reading the receive data register (rdr) with the dmac, select the receive-data-full interrupt of the sci as an activation source using the resource select bit (rs) in the channel control register (chcr). d0 d1 d2 d3 d4 d5 d6 d7 sck tdre t note: during external clock operation, an error may occur if t is 4 states or less. figure 13.22 example of clocked synchronous transmission with dmac cautions for clocked synchronous external clock mode: ? set te = re = 1 only when external clock sck is 1. ? do not set te = re = 1 until at least four clock cycles after external clock sck has changed from 0 to 1. ? when receiving, rdrf is set to 1 when re is cleared to 0 2.5?.5 clocks after the rising edge of the rxd d7 bit sck input, but it cannot be copied to rdr. caution for clocked synchronous internal clock mode: when receiving, rdrf is set to 1 when re is cleared to 0 1.5 clocks after the rising edge of the rxd d7 bit sck output, but it cannot be copied to rdr. .com .com .com .com 4 .com u datasheet
384 .com .com .com .com 4 .com u datasheet
385 section 14 power-down modes 14.1 overview the sh7604 has a module standby function (which selectively halts operation of some on-chip peripheral modules), a sleep mode (which halts cpu function), and a standby mode (which halts all functions). 14.1.1 power-down modes in addition to the sleep mode and standby mode, the sh7604 also has a third power-down mode, the module standby function, which halts the dmac, multiplication unit, division unit, free- running timer, and sci on-chip peripheral modules. table 14.1 shows the transition conditions for entering the modes from the program execution state, as well as the cpu and peripheral module states in each mode and the procedures for canceling each mode. .com .com .com .com 4 .com u datasheet
386 table 14.1 power-down modes state mode transition condition clock cpu, mult, cache ubc, bsc frt, sci, dmac, div, intc, wdt, pins canceling procedure sleep mode sleep instruction executed with sby bit set to 0 in sbycr runs halted runs runs runs 1. interrupt 2. dma address error 3. power- on reset 4. manual reset standby mode sleep instruction executed with sby bit set to 1 in sbycr halted halted held halted held or high impedance 1. nmi interrupt 2. power- on reset 3. manual reset module standby function mstp bit for relevant module is set to 1 runs run (mult is held) runs when mstp bit is 1, the supply of the clock to the relevant module is halted. frt and sci pins are initialized, and others operate. clear mstp bit to 0 14.1.2 register table 14.2 shows the register configuration. table 14.2 register configuration name abbreviation r/w initial value address standby control register sbycr r/w h'60 h'fffffe91 .com .com .com .com 4 .com u datasheet
387 14.2 description of register 14.2.1 standby control register (sbycr) the standby control register (sbycr) is an 8-bit read/write register that sets the power-down mode. sbycr is initialized to h'00 by a reset. bit: 7 6 5 4 3 2 1 0 bit name: sby hiz mstp4 mstp3 mstp2 mstp1 mstp0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w ? bit 7?tandby (sby): specifies transition to standby mode. the sby bit cannot be set to 1 while the watchdog timer is running (when the tme bit in the wdt? wtcsr register is 1). to enter the standby mode, halt the wdt (set the tme bit in wtcsr to 0) and set the sby bit. bit 7: sby description 0 executing a sleep instruction puts the chip into sleep mode (initial value) 1 executing a sleep instruction puts the chip into standby mode ? bit 6?ort high impedance (hiz): selects whether output pins are set to high impedance or retain the output state in standby mode. when hiz = 0 (initial state), the specified pin retains its output state. when hiz = 1, the pin goes to the high-impedance state. see appendix a.1, pin states during resets, power-down states and bus release state, for which pins are controlled. bit 6: hiz description 0 pin state retained in standby mode (initial value) 1 pin goes to high impedance in standby mode ? bit 5?eserved: this bit always reads 0. the write value should always be 0. ? bit 4: module stop 4 (mstp4): specifies halting the clock supply to the dmac. when mstp4 bit is set to 1, the supply of the clock to the dmac is halted. when the clock halts, the dmac retains its pre-halt state. when mstp4 is cleared to 0 and the dmac begins running again, its starts operating from its pre-halt state. set this bit while the dmac is halted; this bit cannot be set while the dmac is operating (transferring data). .com .com .com .com 4 .com u datasheet
388 bit 4: mstp4 description 0 dmac running (initial value) 1 clock supply to dmac halted ? bit 3?odule stop 3 (mstp3): specifies halting the clock supply to the multiplication unit (mult). when the mstp3 bit is set to 1, the supply of the clock to mult is halted. when the clock halts, mult retains its pre-halt state. this bit should be set when the mult is halted. bit 3: mstp3 description 0 mult running (initial value) 1 clock supply to mult halted ? bit 2?odule stop 2 (mstp2): specifies halting the clock supply to the division unit (divu). when the mstp2 bit is set to 1, the supply of the clock to divu is halted. when the clock halts, the divu registers retain their pre-halt state. this bit should be set when the divu is halted. bit 2: mstp2 description 0 divu running (initial value) 1 clock supply to divu halted ? bit 1?odule stop 1 (mstp1): specifies halting the clock supply to the 16-bit free-running timer (frt). when the mstp1 bit is set to 1, the supply of the clock to the frt is halted. when the clock halts, all frt registers are initialized except the frt interrupt vector register in intc, which holds its previous value. when mstp1 is cleared to 0 and the frt begins running again, its starts operating from its initial state. bit 1: mstp1 description 0 frt running (initial value) 1 clock supply to frt halted ? bit 0?odule stop 0 (mstp0): specifies halting the clock supply to the serial communication interface (sci). when the mstp0 bit is set to 1, the supply of the clock to the sci is halted. when the clock halts, all sci registers are initialized except the sci interrupt vector register in intc, which holds its previous value. when mstp0 is cleared to 0 and the sci begins running again, its starts operating from its initial state. .com .com .com .com 4 .com u datasheet
389 bit 0: mstp0 description 0 sci running (initial value) 1 clock supply to sci halted 14.3 sleep mode 14.3.1 transition to sleep mode executing the sleep instruction when the sby bit in sbycr is 0 causes a transition from the program execution state to sleep mode. although the cpu halts immediately after executing the sleep instruction, the contents of its internal registers remain unchanged. the on-chip peripheral modules continue to run in sleep mode. 14.3.2 canceling sleep mode sleep mode is canceled by an interrupt, dma address error, power-on reset, or manual reset. cancellation by an interrupt: when an interrupt occurs, sleep mode is canceled and interrupt exception handling is executed. sleep mode is not canceled if the interrupt cannot be accepted because its priority level is equal to or less than the mask level set in the cpu? status register (sr) or if an interrupt by an on-chip peripheral module is disabled at the peripheral module. cancellation by a dma address error: if a dma address error occurs, sleep mode is canceled and dma address error exception handling is executed. cancellation by a power-on reset: a power-on reset cancels sleep mode. cancellation by a manual reset: a manual reset cancels sleep mode. 14.4 standby mode 14.4.1 transition to standby mode to enter standby mode, set the sby bit to 1 in sbycr, then execute the sleep instruction. the chip switches from the program execution state to standby mode. the nmi interrupt cannot be accepted when the sleep instruction is executed, or for the following five cycles. in standby mode, power consumption is greatly reduced by halting not only the cpu, but the clock and on- chip peripheral modules as well. cpu register contents are held, and some on-chip peripheral modules are initialized. .com .com .com .com 4 .com u datasheet
390 table 14.3 register states in standby mode module registers initialized registers that retain data registers with undefined contents interrupt controller (intc) all registers user break controller (ubc) all registers bus state controller (bsc) all registers dmac dma channel control register 0 dma channel control register 1 dma operation register all registers except dma channel control register 0, dma channel control register 1, and dma operation register divu all registers watchdog timer (wdt) bits 7? of the timer control/status register bits 2? of the timer control/status register reset control/status register timer counter 16-bit free-running timer (frt) all registers serial communication interface (sci) all registers others standby control register frequency modification register 14.4.2 canceling standby mode standby mode is canceled by an nmi interrupt, a power-on reset, or a manual reset. cancellation by an nmi: when a rising edge or falling edge is detected in the nmi signal, after the elapse of the time set in the wdt timer control/status register, clocks are supplied to the entire chip, standby mode is canceled, and nmi exception handling begins. cancellation by a power-on reset: a power-on reset cancels standby mode. cancellation by a manual reset: a manual reset cancels standby mode. .com .com .com .com 4 .com u datasheet
391 14.4.3 standby mode cancellation by nmi the following example describes moving to the standby mode upon the fall of the nmi signal and clearing the standby when the nmi signal rises. figure 14.1 shows the timing. when the nmi pin level changes from high to low after the nmi edge select bit (nmie) of the interrupt control register (icr) has been set to 0 (detect falling edge), an nmi interrupt is accepted. when the nmie bit is set to 1 (detect rising edge) by the nmi exception service routine, the standby bit (sby) of the standby control register (sbycr) is set to 1 and a sleep instruction is executed, the standby mode is entered. the standby mode is cleared the next time the nmi pin level changes from low level to high level. oscillator ckio (output) nmi nmie sby oscillation settling time standby mode start of oscillation wdt set time nmi exception handling exception service routine, sby = 1, sleep instruction nmi exception handling figure 14.1 standby mode cancellation by nmi 14.4.4 clock pause function when the clock is input from the ckio pin, the clock frequency can be modified or the clock stopped. the sh7604 has a ckpreq /ckm pin for this purpose. the clock pause function is used as described below. note that clock pauses are not accepted while the watchdog timer (wdt) is operating (i.e. when the timer enable bit (tme) in the wdt? timer control/status register (wtcsr) is 1). .com .com .com .com 4 .com u datasheet
392 1. set the tme bit in the watchdog timer? wtcsr register to 0. 2. set the overflow time in bits cks2 to cks0 bits in the watchdog timer? wtcsr register (overflow time should be calculated using the clock frequency after modification). 3. after the sleep instruction is executed and standby mode is entered, apply a low level from the ckpreq /ckm pin. 4. when the chip is internally ready to modify the operating clock, a low level is output from the ckpack pin. 5. after the ckpack pin goes low, the clocks are stopped and the frequency is modified. the internal chip state is the same as in standby mode. 6. when the clock pause state (standby) is canceled, the wdt starts to count up at the falling edge or rising edge of the nmi pin (when the nmie bit of intc is set). 7. when a frequency is modified, the ckpack pin goes high after the time set by the wdt, and the clock pause function gives external notification that the chip can again be operated (standby mode is canceled). 8. when a clock is halted, the clock is applied again to the ckio pin and nmi input is generated. after the time set by the wdt, the ckpack pin goes high, and the clock pause function gives external notification that the chip can again be operated (standby mode is canceled). the standby state, all internal functions and all pin states during clock pause are equivalent to those of the normal standby mode. figure 14.2 shows the timing chart for the clock pause function. clock frequency modification ckio input ckpreq /ckm input ckpack output nmi input clock pause request cancellation standby time wdt setting time nmi exception handling waiting for clock pause figure 14.2 clock pause function timing .com .com .com .com 4 .com u datasheet
393 14.4.5 notes on standby mode 1. when the sh7604 enters standby mode during use of the cache, disable the cache before making the mode transition. initialize the cache beforehand when the cache is used after returning to standby mode. the contents of the on-chip ram are not retained in standby mode when cache is used as on-chip ram. 2. if an on-chip peripheral register is written in the 10 clock cycles before the sh7604 transits to standby mode, read the register before executing the sleep instruction. 3. when using clock mode 0, 1, or 2, the ckio pin is the clock output pin. note the following when standby mode is used in these clock modes. when standby mode is canceled by nmi, an unstable clock is output from the ckio pin during the oscillation settling time after nmi input. this also applies to clock output in the case of cancellation by a power-on reset or manual reset. power-on reset and manual reset input should be continued for a period at least equal to for the oscillation settling time. 14.5 module standby function 14.5.1 transition to module standby function by setting one of standby control register bits mstp4?stp0 to 1, the supply of the clock to the corresponding on-chip peripheral module can be halted. this function can be used to reduce the power consumption in sleep mode. do not perform read/write operations for a module in module standby mode. the external pins and registers of the dmac, mult, and divu on-chip peripheral modules retain their states prior to halting. the external pins of the frt and sci are reset and all their registers are initialized. do not switch on-chip peripheral modules to module standby mode while they are running. 14.5.2 clearing the module standby function clear the module standby function by clearing the mstp4?stp0 bits, or by a power-on reset or manual reset. to effect a module stop, halt the relevant module or disable interrupts. .com .com .com .com 4 .com u datasheet
394 .com .com .com .com 4 .com u datasheet
395 section 15 electrical characteristics (5v version) 15.1 absolute maximum ratings table 15.1 shows the absolute maximum ratings. table 15.1 absolute maximum ratings item symbol rating unit power supply voltage v cc ?.3 to +7.0 v input voltage vin ?.3 to v cc + 0.3 v operating temperature topr ?0 to +75 c storage temperature tstg ?5 to +125 c caution: operating the chip in excess of the absolute maximum rating may result in permanent damage. .com .com .com .com 4 .com u datasheet
396 15.2 dc characteristics tables 15.2 and 15.3 list dc characteristics. table 15.2 dc characteristics (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min typ max unit test conditions input high- res , nmi, v ih v cc ?0.5 v cc + 0.3 v during standby level md5?d0 v cc ?0.7 v cc + 0.3 v normal operation voltage extal, ckio v cc ?0.7 v cc + 0.3 v other input pins 2.2 v cc + 0.3 v input low- res , nmi, v il ?.3 0.5 v during standby level md5?d0 ?.3 0.8 v normal operation voltage other input pins ?.3 0.8 v input leak res |iin| 1.0 a vin = 0.5 to v cc ?0.5 v current nmi, md5?d0 1.0 a vin = 0.5 to v cc ?0.5 v other input pins 1.0 a vin = 0.5 to v cc ?0.5 v 3-state leak current (while off) a26?0, d31 d0, bs , cs3 cs0 , rd/ wr , ras , cas , we3 we0 , rd , ivecf |i sti | 1.0 a vin = 0.5 to v cc ?0.5 v output all output pins v oh v cc ?0.5 v i oh = ?00 a high-level voltage 3.5 v i oh = ? ma output low-level voltage all output pins v ol 0.4 v i ol = 1.6 ma input res cin 15 pf vin = 0 v capaci- nmi 15 pf f = 1 mhz tance all other input pins (including d31?0) 15 pf ta = 25 c .com .com .com .com 4 .com u datasheet
397 table 15.2 dc characteristics (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) (cont) item symbol min typ max unit test conditions current normal i cc 60 80 ma f = 8 mhz consump- operation 80 100 ma f = 16 mhz tion 110 160 ma f = 28.7 mhz sleep 30 55 ma f = 8 mhz 50 70 ma f = 16 mhz 80 100 ma f = 28.7 mhz standby 1 15 a ta 50 c 60 a50 c < ta notes: 1. when no pll is used, do not leave the pllv cc and pllv ss pins open. connect pllv cc to v cc and pllv ss to v ss . 2. current consumption values shown are the values at which all output pins are without load under conditions of v ih min = v cc ?0.5 v, v il max = 0.5 v. table 15.3 permitted output current values (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min typ max unit output low-level permissible current (per pin) i ol 2.0 ma output low-level permissible current (total) i ol 80ma output high-level permissible current (per pin) ? oh 2.0 ma output high-level permissible current (total) (? oh )25ma caution: to ensure chip reliability, do not exceed the output current values given in table 15.3. .com .com .com .com 4 .com u datasheet
398 15.3 ac characteristics 15.3.1 clock timing table 15.4 clock timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures operating frequency f op 4 28.7 mhz 15.1 clock cycle time t cyc 35 143 *1 or 250 *2 ns clock high pulse width t ch 8 *1 or 15 *2 ?s clock low pulse width t cl 8 *1 or 15 *2 ?s clock rise time t cr ? ns clock fall time t cf ? ns extal clock input frequency f ex 4 8 mhz 15.2 extal clock input cycle time t excyc 125 250 ns extal clock input low-level pulse width t exl 50 ns extal clock input high-level pulse width t exh 50 ns extal clock input rise time t exr ? ns extal clock input clock fall time t exf ? ns power-on oscillation settling time t osc1 10 ms 15.3 software standby oscillation settling time 1 t osc2 10 ms 15.4 software standby oscillation settling time 2 t osc3 10 ms 15.5 pll synchronization settling time t pll 1 s 15.6 notes: 1. with pll circuit 1 operating. 2. with pll circuit 1 not used. t ch 1/2 v cc t cf t cr 1/2 v cc v ih ckio (input) v ih v ih v il v il t cl t cyc figure 15.1 ckio input timing .com .com .com .com 4 .com u datasheet
399 extal (input) 1/2 v cc t excyc t exl t exh t exf t exr v ih v ih v il v il v ih 1/2 v cc note: external clock input from extal pin. figure 15.2 extal clock input timing ckio, internal clock v cc v cc min res t osc1 t resw stable oscillation note: oscillation settling time when on-chip crystal oscillator is used. figure 15.3 oscillation settling time at power-on .com .com .com .com 4 .com u datasheet
400 ckio, internal clock stable oscillation standby period t osc2 t resw res note: oscillation settling time when on-chip crystal oscillator is used. figure 15.4 oscillation settling time at standby return (via res ) ckio, internal clock stable oscillation standby period t osc3 nmi note: oscillation settling time when on-chip crystal oscillator is used. figure 15.5 oscillation settling time at standby return (via nmi) .com .com .com .com 4 .com u datasheet
401 stable oscillation stable oscillation oscillation frequency modification t pll pll synchronization pll synchronization extal or ckio internal clock figure 15.6 pll synchronization settling time .com .com .com .com 4 .com u datasheet
402 15.3.2 control signal timing table 15.5 control signal timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figure res rise, fall t resr , t resf 200 ns 15.7 res pulse width t resw 20 t cyc nmi reset setup time t nmirs tcyc + 10 ns nmi reset hold time t nmirh tcyc + 10 ns nmi rise, fall t nmir , t nmif 200 ns nmi minimum pulse width t irqes 3 tcyc res setup time * t ress 30 ns 15.8, nmi setup time * t nmis 30 ns 15.9 irl3 irl0 setup time * t irls 30 ns res hold time t resh 10 ns 15.8, nmi hold time t nmih 10 ns 15.9 irl3 irl0 hold time t irlh 10 ns brls setup time 1 (pll on) t blss1 1/2 tcyc + 9 ns 15.10 brls hold time 1 (pll on) t blsh1 9 1/2 tcyc ns bgr delay time 1 (pll on) t bgrd1 1/2 tcyc + 18 ns brls setup time 1 (pll on, 1/4 cycle delay) t blss1 1/4 tcyc + 9 ns 15.10 brls hold time 1 (pll on, 1/4 cycle delay) t blsh1 9 1/4 tcyc ns bgr delay time 1 (pll on, 1/4 cycle delay) t bgrd1 3/4 tcyc + 18 ns brls setup time 2 (pll off) t blss2 9 ns 15.11 brls hold time 2 (pll off) t blsh2 19 ns bgr delay time 2 (pll off) t bgrd2 28 ns note: the res , nmi and irl3 - irl0 signals are asynchronous inputs, but when the setup times shown here are observed, the signals are considered to have changed at clock fall. if the setup times are not observed, recognition may be delayed until the next clock fall. .com .com .com .com 4 .com u datasheet
403 table 15.5 control signal timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) (cont) item symbol min max unit figure breq delay time 1 (pll on) t brqd1 1/2 tcyc + 18 ns 15.12 back setup time 1 (pll on) t baks1 1/2 tcyc + 9 ns back hold time 1 (pll on) t bakh1 9 1/2 tcyc ns breq delay time 1 (pll on, 1/4 cycle delay) t brqd1 3/4 tcyc + 18 ns 15.12 back setup time 1 (pll on, 1/4 cycle delay) t baks1 1/4 tcyc + 9 ns back hold time 1 (pll on, 1/4 cycle delay) t bakh1 9 1/4 tcyc ns breq delay time 2 (pll off) t brqd2 28 ns 15.13 back setup time 2 (pll off) t baks2 9 ns back hold time 2 (pll off) t bakh2 19 ns bus tri-state delay time 1 (pll on) t boff1 0 25 ns 15.10, bus buffer on time 1 (pll on) t bon1 018ns 15.12 bus tri-state delay time 1 (pll on, 1/4 cycle delay) t boff1 1/4 tcyc 1/4 tcyc + 25 ns 15.10, 15.12 bus buffer on time 1 (pll on, 1/4 cycle delay) t bon1 1/4 tcyc 1/4 tcyc + 18 ns bus tri-state delay time 1 (pll off) t boff1 0 30 ns 15.11, bus buffer on time 1 (pll off) t bon1 025ns 15.13 bus tri-state delay time 2 (pll on) t boff2 1/2 tcyc 1/2 tcyc + 25 ns 15.10, bus buffer on time 2 (pll on) t bon2 1/2 tcyc 1/2 tcyc + 18 ns 15.12 bus tri-state delay time 2 (pll on, 1/4 cycle delay) t boff2 3/4 tcyc 3/4 tcyc + 25 ns 15.10, bus buffer on time 2 (pll on, 1/4 cycle delay) t bon2 3/4 tcyc 3/4 tcyc + 18 ns 15.12 bus tri-state delay time 3 (pll off) t boff3 0 30 ns 15.11, bus buffer on time 3 (pll off) t bon3 025ns 15.13 .com .com .com .com 4 .com u datasheet
404 t nmirs t resw t resf t resr t nmirh res nmi v ih v il v ih v il v ih v il v ih v il figure 15.7 reset input timing t ress ckio res t inmis nmi t irls irl3 irl0 t resh t nmih t irlh v ih v il v ih v il v ih v il figure 15.8 interrupt signal input timing (with pll1 off) .com .com .com .com 4 .com u datasheet
405 ckio res t resh t ress v ih v il nmi t nmih t nmis v ih v il irl3 irl0 t irlh t irls v ih v il 1/2 t cyc or 3/4 t cyc 1/2 t cyc or 3/4 t cyc figure 15.9 interrupt signal input timing (pll1 on) t blss1 ckio brls (input) bgr (output) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 t boff2 t boff1 t blsh1 t bgrd1 t blss1 t blsh1 t bon2 t bon1 t bgrd1 figure 15.10 bus release timing (master mode, pll1 on) .com .com .com .com 4 .com u datasheet
406 a26 a0 d31 d0 rd , rd/ wr , ras , cas , csn , wen , bs , ivecf brls (input) bgr (output) t blss2 ckio t boff1 t bon1 t bon3 t boff3 t bgrd2 t bgrd2 t blsh2 t blss2 t blsh2 figure 15.11 bus release timing (master mode, pll1 off) back (input) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 breq (output) t bakh1 ckio t brqd1 t brqd1 t bakh1 t baks1 t bon2 t bon1 t boff1 t boff2 t baks1 figure 15.12 bus release timing (slave mode, pll1 on) .com .com .com .com 4 .com u datasheet
407 back (input) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 breq (output) ckio t brqd2 t brqd1 t bakh2 t baks2 t bon3 t bon1 t boff1 t boff3 t bakh2 t baks2 figure 15.13 bus release timing (slave mode, pll1 off) .com .com .com .com 4 .com u datasheet
408 15.3.3 bus timing table 15.6 bus timing with pll on [mode 0, 4] (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 3 18 ns 15.14, 15.20, 15.40, 15.52, 15.66, 15.68 bs delay time t bsd 21 ns 15.14, 15.20, 15.40, 15.52, 15.66 cs delay time 1 t csd1 21 ns 15.14, 15.20, 15.40, 15.52, 15.66 cs delay time 2 t csd2 1/2 tcyc + 21 ns 15.14, 15.66 read/write delay time t rwd 3 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 read strobe delay time 1 t rsd1 1/2 tcyc + 16 ns 15.14, 15.40, 15.52, 15.66, 15.68 read data setup time 1 t rds1 1/2 tcyc + 10 ns 15.14, 15.40, 15.52, 15.66, 15.68 read data setup time 3 (sdram) t rds3 1/2 tcyc + 8 ns 15.20 read data hold time 2 t rdh2 0 ns 15.14, 15.66 read data hold time 4 (sdram) t rdh4 0 ns 15.20 read data hold time 5 (dram) t rdh5 0 ns 15.40 read data hold time 6 (psram) t rdh6 0 ns 15.52 read data hold time 7 (interrupt vector) t rdh7 0 ns 15.68 write enable delay time t wed1 1/2 tcyc + 3 1/2 tcyc + 18 ns 15.14, 15.15, 15.52, 15.53 write data delay time 1 t wdd 3 18 ns 15.15, 15.27, 15.41, 15.53 write data hold time 1 t wdh1 3 ns 15.15, 15.27, 15.41, 15.53 data buffer on time t don 18 ns 15.15, 15.27, 15.41, 15.53 data buffer off time t dof 18 ns 15.15, 15.27, 15.41, 15.53 .com .com .com .com 4 .com u datasheet
409 table 15.6 bus timing with pll on [mode 0, 4] (cont) (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures dack delay time 1 t dacd1 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 dack delay time 2 t dacd2 1/2 tcyc + 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 wait setup time t wts 20 ns 15.19, 15.43, 15.55, 15.66, 15.70 wait hold time t wth 5 ns 15.19, 15.43, 15.55, 15.66, 15.70 ras delay time 1 (sdram) t rasd1 18 ns 15.20 ras delay time 2 (dram) t rasd2 1/2 tcyc + 3 1/2 tcyc + 18 ns 15.40 cas delay time 1 (sdram) t casd1 18 ns 15.20 cas delay time 2 (dram) t casd2 1/2 tcyc + 3 1/2 tcyc + 18 ns 15.40 dqm delay time t dqmd 18 ns 15.20 cke delay time t cked 21 ns 15.37 ce delay time 1 t ced1 1/2 tcyc + 3 1/2 tcyc + 18 ns 15.52 oe delay time 1 t oed1 1/2 tcyc + 18 ns 15.52 ivecf delay time t ivd 18 ns 15.68 address input setup time t asin 14 ns 15.71 address input hold time t ahin 3 ns 15.71 bs input setup time t bss 15 ns 15.71 bs input hold time t bsh 3 ns 15.71 read/write input setup time t rws 15 ns 15.71 read/write input hold time t rwh 3 ns 15.71 address hold time 1 t ah1 5 ns 15.15 .com .com .com .com 4 .com u datasheet
410 table 15.7 bus timing with pll on and 1/4 cycle delay [mode 1, 5] (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 1/4 tcyc + 3 1/4 tcyc + 18 ns 15.14, 15.20, 15.40, 15.52, 15.66, 15.68 bs delay time t bsd 1/4 tcyc + 21 ns 15.14, 15.20, 15.40, 15.52, 15.66 cs delay time 1 t csd1 1/4 tcyc + 21 ns 15.14, 15.20, 15.40, 15.52, 15.66 cs delay time 2 t csd2 3/4 tcyc + 21 ns 15.14, 15.66 read/write delay time t rwd 1/4 tcyc + 3 1/4 tcyc + 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 read strobe delay time 1 t rsd1 3/4 tcyc + 16 ns 15.14, 15.40, 15.52, 15.66, 15.68 read data setup time 1 t rds1 1/4 tcyc + 10 ns 15.14, 15.40, 15.52, 15.66, 15.68 read data setup time 3 (sdram) t rds3 1/4 tcyc + 8 ns 15.20 read data hold time 2 t rdh2 0 ns 15.14, 15.66 read data hold time 4 (sdram) t rdh4 0 ns 15.20 read data hold time 5 (dram) t rdh5 0 ns 15.40 read data hold time 6 (psram) t rdh6 0 ns 15.52 read data hold time 7 (interrupt vector) t rdh7 0 ns 15.68 write enable delay time t wed1 3/4 tcyc + 3 3/4 tcyc + 18 ns 15.14, 15.15, 15.52, 15.53 write data delay time 1 t wdd 1/4 tcyc + 3 1/4 tcyc + 18 ns 15.15, 15.27, 15.41, 15.53 write data hold time 1 t wdh1 1/4 tcyc + 3 ns 15.15, 15.27, 15.41, 15.53 data buffer on time t don 1/4 tcyc + 18 ns 15.15, 15.27, 15.41, 15.53 data buffer off time t dof 1/4 tcyc + 18 ns 15.15, 15.27, 15.41, 15.53 .com .com .com .com 4 .com u datasheet
411 table 15.7 bus timing with pll on and 1/4 cycle delay [mode 1, 5] (cont) (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures dack delay time 1 t dacd1 1/4 tcyc + 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 dack delay time 2 t dacd2 3/4 tcyc + 18 ns 15.14, 15.20, 15.40, 15.52, 15.66 wait setup time t wts 20 1/4 tcyc ns 15.19, 15.43, 15.55, 15.66, 15.70 wait hold time t wth 1/4 tcyc + 5 ns 15.19, 15.43, 15.55, 15.66, 15.70 ras delay time 1 (sdram) t rasd1 1/4 tcyc + 18 ns 15.20 ras delay time 2 (dram) t rasd2 3/4 tcyc + 3 3/4 tcyc + 18 ns 15.40 cas delay time 1 (sdram) t casd1 1/4 tcyc + 18 ns 15.20 cas delay time 2 (dram) t casd2 3/4 tcyc + 3 3/4 tcyc + 18 ns 15.40 dqm delay time t dqmd 1/4 tcyc + 18 ns 15.20 cke delay time t cked 1/4 tcyc + 21 ns 15.37 ce delay time 1 t ced1 3/4 tcyc + 3 3/4 tcyc + 18 ns 15.52 oe delay time 1 t oed1 3/4 tcyc + 18 ns 15.52 ivecf delay time t ivd 1/4 tcyc + 18 ns 15.68 address input setup time t asin 14 1/4 tcyc ns 15.71 address input hold time t ahin 1/4 tcyc + 3 ns 15.71 bs input setup time t bss 15 1/4 tcyc ns 15.71 bs input hold time t bsh 1/4 tcyc + 3 ns 15.71 read/write input setup time t rws 15 1/4 tcyc ns 15.71 read/write input hold time t rwh 1/4 tcyc + 3 ns 15.71 address hold time 1 t ah1 5 ns 15.15 .com .com .com .com 4 .com u datasheet
412 table 15.8 bus timing with pll off (ckio input) [mode 6] (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 13 28 ns 15.16, 15.38, 15.47, 15.60, 15.67, 15.69 bs delay time t bsd 30 ns 15.16, 15.38, 15.47, 15.60, 15.67 cs delay time 1 t csd1 30 ns 15.16, 15.38, 15.47, 15.60, 15.67 cs delay time 3 t csd3 28 ns 15.16, 15.67 read write delay time t rwd 13 28 ns 15.16, 15.38, 15.47, 15.60, 15.67 read strobe delay time 2 t rsd2 26 ns 15.16, 15.47, 15.60, 15.67, 15.69 read data setup time 2 t rds2 10 ns 15.16, 15.38, 15.47, 15.60, 15.67, 15.69 read data hold time 2 t rdh2 0 ns 15.16, 15.67 read data hold time 3 t rdh3 15 ns 15.38 read data hold time 5 (dram) t rdh5 0 ns 15.47 read data hold time 6 (psram) t rdh6 0 ns 15.60 read data hold time 7 (interrupt vector) t rdh7 0 ns 15.69 write enable delay time 2 t wed2 10 25 ns 15.17, 15.61 write data delay time t wdd 10 25 ns 15.17, 15.39, 15.48, 15.61 write data hold time 1 t wdh1 3 ns 15.17, 15.39, 15.48, 15.61 write data hold time 2 t wdh2 5 ns 15.17 write data hold time 3 t wdh3 3 ns 15.61 dack delay time 1 t dacd1 25 ns 15.16, 15.38, 15.47, 15.60, 15.67 dack delay time 3 t dacd3 25 ns 15.16, 15.38, 15.47, 15.60, 15.67 .com .com .com .com 4 .com u datasheet
413 table 15.8 bus timing with pll off (ckio input) [mode 6] (cont) (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures wait setup time t wts 20 ns 15.19, 15.43, 15.55, 15.67, 15.70 wait hold time t wth 15 ns 15.19, 15.43, 15.55, 15.67, 15.70 ras delay time 1 (sdram) t rasd1 25 ns 15.38 ras delay time 3 (dram) t rasd3 10 25 ns 15.47 cas delay time 1 (sdram) t casd1 25 ns 15.38 cas delay time 3 (dram) t casd3 10 25 ns 15.47 dqm delay time t dqmd 25 ns 15.38 cke delay time t cked 25 ns 15.37 ce delay time 2 t ced2 10 25 ns 15.60 oe delay time 2 t oed2 25 ns 15.60 ivecf delay time t ivd 25 ns 15.69 we setup time t wes1 0 ns 15.16 address setup time 1 t as1 0 ns 15.17 address setup time 2 t as2 3 ns 15.60 address hold time 2 t ah2 0 ns 15.17 row address setup time t asr 3 ns 15.47 column address setup time t asc 3 ns 15.47 write command setup time t wcs 3 ns 15.48 write data setup time t wds 3 ns 15.48 address input setup time * t asin 15 ns 15.71 address input hold time * t ahin 10 ns 15.71 bs input setup time * t bss 15 ns 15.71 bs input hold time * t bsh 10 ns 15.71 read/write input setup time * t rws 15 ns 15.71 read/write input hold time * t rwh 10 ns 15.71 data buffer on time t don 25 ns 15.17, 15.39, 15.48, 15.61 data buffer off time t dof 25 ns 15.17, 15.39, 15.48, 15.61 note: when the external addresses monitor function is used, the pll must be on. .com .com .com .com 4 .com u datasheet
414 table 15.9 bus timing with pll off (ckio output) [mode 2] (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 3 18 ns 15.16, 15.38, 15.47, 15.60, 15.67, 15.69 bs delay time t bsd 21 ns 15.16, 15.38, 15.47, 15.60, 15.67 cs delay time 1 t csd1 21 ns 15.16, 15.38, 15.47, 15.60, 15.67 cs delay time 3 t csd3 21 ns 15.16, 15.67 read write delay time t rwd 3 18 ns 15.16, 15.38, 15.47, 15.60, 15.67 read strobe delay time 2 t rsd2 16 ns 15.16, 15.47, 15.60, 15.67, 15.69 read data setup time 2 t rds2 12 ns 15.16, 15.38, 15.47, 15.60, 15.67, 15.69 read data hold time 2 t rdh2 0 ns 15.16, 15.67 read data hold time 3 (sdram) t rdh3 1/2 tcyc ns 15.38 read data hold time 5 (dram) t rdh5 0 ns 15.47 read data hold time 6 (psram) t rdh6 0 ns 15.60 read data hold time 7 (interrupt vector) t rdh7 0 ns 15.69 write enable delay time 2 t wed2 3 18 ns 15.17, 15.61 write data delay time t wdd 3 18 ns 15.17, 15.39, 15.48, 15.61 write data hold time 1 t wdh1 3 ns 15.17, 15.39, 15.48, 15.61 write data hold time 2 t wdh2 5 ns 15.17 write data hold time 3 t wdh3 3 ns 15.61 dack delay time 1 t dacd1 18 ns 15.16, 15.38, 15.47, 15.60, 15.67 dack delay time 3 t dacd3 18 ns 15.16, 15.38, 15.47, 15.60, 15.67 .com .com .com .com 4 .com u datasheet
415 table 15.9 bus timing with pll off (ckio output) [mode 2] (cont) (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figures wait setup time t wts 22 ns 15.19, 15.43, 15.55, 15.67, 15.70 wait hold time t wth 5 ns 15.19, 15.43, 15.55, 15.67, 15.70 ras delay time 1 (sdram) t rasd1 18 ns 15.38 ras delay time 3 (dram) t rasd3 3 18 ns 15.47 cas delay time 1 (sdram) t casd1 18 ns 15.38 cas delay time 3 (dram) t casd3 3 18 ns 15.47 dqm delay time t dqmd 18 ns 15.38 cke delay time t cked 21 ns 15.37 ce delay time 2 t ced2 3 18 ns 15.60 oe delay time 2 t oed2 18 ns 15.60 ivecf delay time t ivd 18 ns 15.69 address input setup time * t asin 14 ns 15.71 address input hold time * t ahin 3 ns 15.71 bs input setup time * t bss 15 ns 15.71 bs input hold time * t bsh 3 ns 15.71 read/write input setup time * t rws 15 ns 15.71 read/write input hold time * t rwh 3 ns 15.71 data buffer on time t don 18 ns 15.17, 15.39, 15.48, 15.61 data buffer off time t dof 18 ns 15.17, 15.39, 15.48, 15.61 address hold time 2 t ah2 5 ns 15.17 note: when the external addresses monitor function is used, the pll must be on. .com .com .com .com 4 .com u datasheet
416 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t wed1 t rds1 t rdh2 t wed1 t csd2 t rsd1 t rsd1 t dacd1 t dacd2 notes: 1. 2. 3. the dotted line shows the waveform when synchronous dram is connected. t rdh2 is specified from the rise of csn or rd , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 15.14 basic read cycle (no waits, pll on) .com .com .com .com 4 .com u datasheet
417 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t rsd1 t rsd1 t csd2 t wed1 t wed1 t ah1 t dacd1 t dacd2 t don t wdh1 t wdd t dof notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 15.15 basic write cycle (no waits, pll on) .com .com .com .com 4 .com u datasheet
418 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rds2 t rdh2 t csd3 t rsd2 t dacd1 t dacd3 t rwd t rsd2 t wes1 notes: 1. 2. 3. the dotted line shows the waveform when synchronous dram is connected. t rdh2 is specified from the rise of csn or rd , whichever is first. the dackn waveform shown is for the case where active-hi g h has been specified. figure 15.16 basic read cycle (no waits, pll off) .com .com .com .com 4 .com u datasheet
419 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t rsd2 t rsd2 t dacd1 t dacd3 t don t wdd t as1 t csd3 t wed2 t wed2 t wdh1 t wdh2 t dof t ah2 notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 15.17 basic write cycle (no waits, pll off) .com .com .com .com 4 .com u datasheet
420 t 1 t w t 2 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t wth t wts notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 15.18 basic bus cycle (1 wait cycle) .com .com .com .com 4 .com u datasheet
421 t 1 t w t wx t 2 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t wts t wth t wts t wth notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 15.19 basic bus cycle (external wait input) .com .com .com .com 4 .com u datasheet
422 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t r t c t d1 t d2 t d3 t d4 t ad t ad t ad t ad t ad t ad t bsd t bsd t bsd t rwd t csd1 t csd1 t rwd t dqmd t rds3 t dacd2 t dacd2 t dacd2 t dacd2 t rdh4 t rds3 t rdh4 t rds3 t rdh4 t rds3 t rdh4 t dacd1 t dacd1 t rasd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t casd1 t dacd1 t dacd1 t dqmd t rsd1 notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-hi g h has been specified. figure 15.20 synchronous dram read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, bursts = 4, pll on) .com .com .com .com 4 .com u datasheet
423 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 wait upper address lower address t r t c t d1 t d2 t d3 t d4 t ad t ad t ad t bsd t bsd t bsd t bsd t rwd t csd1 t csd1 t rwd t dqmd t rds3 t rdh4 t rasd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t casd1 t dqmd t rsd1 note: the dotted line shows the waveform when synchronous dram in another cs space is accessed. figure 15.21 synchronous dram single read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, bursts = 4, pll on) .com .com .com .com 4 .com u datasheet
424 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t r t rw t c t w t d1 t d2 t d3 t d4 t bsd t rasd1 t casd1 t casd1 t rasd1 notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 15.22 synchronous dram read bus cycle (rcd = 2 cycles, cas latency = 2 cycles, bursts = 4) .com .com .com .com 4 .com u datasheet
425 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx cas , oe cke d31 d0 dackn wait ras , ce upper address lower address t nop t c t d1 t d2 t d3 t d4 t ad t bsd t rwd t csd1 t dqmd t dacd1 t rasd1 t casd1 t casd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.23 synchronous dram read bus cycle (bank active, same row access, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
426 upper address lower address bs ckio t c t w t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t dqmd note: the dackn waveform shown is for the case where active-high has been specified. figure 15.24 synchronous dram read bus cycle (bank active, same row access, cas latency = 2 cycles) .com .com .com .com 4 .com u datasheet
427 upper address lower address bs ckio t p t r t c t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t bsd t csd1 t rwd t rwd t dacd1 t rasd1 t rasd1 t dqmd note: the dackn waveform shown is for the case where active-high has been specified. figure 15.25 synchronous dram read bus cycle (bank active, different row access, trp = 1 cycle, rcd = 1 cycle, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
428 upper address lower address bs ckio t p t pw t r t c t d1 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rwd t rasd1 t rasd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.26 synchronous dram read bus cycle (bank active, different row access, trp = 2 cycles, rcd = 1 cycle, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
429 ckio t r t c t ap upper address wen casxx dqmxx d31 d0 lower address bs csn rd rd/ wr we dackn wait ras ce cas oe cke t ad t ad t ad t bsd t csd1 t rwd t dqmd t dacd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t rasd1 t rasd1 t dqmd t dacd1 t dacd2 t don t wdd t rwd t rwd t rsd1 t csd1 t csd1 t bsd t bsd t wdh1 notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. t dof figure 15.27 synchronous dram write bus cycle (rcd = 1 cycle, trwl = 1 cycle, pll on) .com .com .com .com 4 .com u datasheet
430 tr trw tc trwl tap ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rasd1 t casd1 t rasd1 t dacd1 t csd1 notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 15.28 synchronous dram write bus cycle (rcd = 2 cycles, trwl = 2 cycles) .com .com .com .com 4 .com u datasheet
431 tc ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t bsd t bsd t csd1 t csd1 t rwd t rwd t dqmd t dqmd t wdd t dof t wdh1 t don t dacd2 t dacd1 t rasd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.29 synchronous dram write bus cycle (bank active, same row access) .com .com .com .com 4 .com u datasheet
432 tc ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad tc t dqmd t wdd t wdh1 t dacd2 t dacd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.30 synchronous dram consecutive write cycles (bank active, same row access) .com .com .com .com 4 .com u datasheet
433 ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad tp tr tc t bsd t csd1 t rwd t rwd t dqmd t dqmd t dacd1 t rasd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.31 synchronous dram write bus cycle (bank active, different row access, trp = 1 cycle, rcd = 1 cycle) .com .com .com .com 4 .com u datasheet
434 upper address lower address bs ckio tp t pw t r t rw t c csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rwd t dqmd t rasd1 t rasd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.32 synchronous dram write bus cycle (bank active, different row access, trp = 2 cycles, rcd = 2 cycles) .com .com .com .com 4 .com u datasheet
435 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t p t mw t ad t bsd t ad lower address t ad t csd1 t rwd t rwd t dqmd t csd1 t csd1 t rasd1 t rasd1 t rasd1 t csd1 t csd1 t bsd figure 15.33 synchronous dram mode register write cycle (trp = 1 cycle) .com .com .com .com 4 .com u datasheet
436 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t p t pw t mw lower address t rwd t rwd t rasd1 t rasd1 figure 15.34 synchronous dram mode register write cycle (trp = 2 cycles) .com .com .com .com 4 .com u datasheet
437 ckio bs csn rd rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t rr t rc1 t re t nop t rc2 lower address t rasd1 t rasd1 t rasd1 t casd1 t casd1 t ad t ad t csd1 t rwd t rwd t bsd t csd1 note: a precharge cycle always precedes the auto-refresh cycle by the number of cycles specified by trp. figure 15.35 synchronous dram auto-refresh cycle (tras = 2 cycles) .com .com .com .com 4 .com u datasheet
438 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe d31 d0 dackn wait upper address t p t rr t rc2 t re t nop t rc1 lower address cke t rasd1 t casd1 t ad t ad t bsd t csd1 t rwd t rwd figure 15.36 synchronous dram auto-refresh cycle (shown from precharge cycle, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
439 upper address lower address bs ckio trr t rc1 t rc2 t re t rc1 csn rd/ wr we wen casxx dqmxx d31 d0 dackn rd wait ras ce cas oe cke note: a precharge cycle always precedes the self-refresh cycle by the number of cycles specified by trp. t ad t rwd t ad t rasd1 t casd1 t cked t cked t rasd1 t csd1 t csd1 t re t nap t rasd1 t casd1 figure 15.37 synchronous dram self-refresh cycle (tras = 2) .com .com .com .com 4 .com u datasheet
440 upper address lower address bs ckio tr t c t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t ad t ad t ad t ad t bsd t rasd1 t rasd1 t rasd1 t casd1 t csd1 t rwd t dqmd t rds2 t dacd1 t dqmd t rwd t bsd t casd1 t casd1 t casd1 t rsd2 t rds2 t rdh3 t rdh3 t rdh3 t rdh3 t rds2 t rds2 t dacd3 t dacd3 t dacd1 t dacd1 t dacd3 t dacd3 t dacd1 t csd1 t bsd notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 15.38 synchronous dram read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, trp = 1 cycle, bursts = 4, pll off) .com .com .com .com 4 .com u datasheet
441 ckio t r t c t ap upper address lower address wen casxx dqmxx bs csn rd/ wr we rd d31 d0 dackn wait ras ce cas oe cke t wdd t don t dacd3 t wdh1 t dof notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 15.39 synchronous dram write bus cycle (rcd = 1 cycle, trwl = 1 cycle, pll off) .com .com .com .com 4 .com u datasheet
442 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t rds1 t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd1 t rsd1 t casd2 t casd2 t csd1 t csd1 t rwd t rwd t casd2 t rasd2 t rasd2 t rasd2 t rdh5 t dacd1 t rsd1 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 15.40 dram read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
443 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t casd2 t casd2 t csd1 t csd1 t rwd t rwd t casd2 t rasd2 t rasd2 t rasd2 t dacd1 t rsd1 t rwd t don t wdh1 t wdd t dof note: the dackn waveform shown is for the case where active-high has been specified. figure 15.41 dram write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
444 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t pw t r t rw t c1 t c2 t w t wth t wts note: the dackn waveform shown is for the case where active-hi g h has been specified. figure 15.42 dram bus cycle (trp = 2 cycles, rcd = 2 cycles, 1 wait) .com .com .com .com 4 .com u datasheet
445 ckio t p t r t c1 t w t wx t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t wts t wth t wts t wth note: the dackn waveform shown is for the case where active-high has been specified. figure 15.43 dram bus cycle (trp = 1 cycle, rcd = 1 cycle, external wait input) .com .com .com .com 4 .com u datasheet
446 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rsd1 t rsd1 t casd2 t casd2 t dacd2 t rds1 csn t bsd t rdh5 t rds1 t rdh5 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 15.44 dram burst read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
447 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas oe cke d31 d0 dackn wait upper address lower address t wdh1 t bsd t casd2 t casd2 t wdd t dacd2 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.45 dram burst write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
448 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t csd1 t rr t rc1 t rc2 t re t casd2 t casd2 t casd2 t rasd2 t rasd2 t rasd2 t csd1 figure 15.46 dram cas-before-ras refresh cycle (trp = 1 cycle, tras = 2 cycles, pll on) .com .com .com .com 4 .com u datasheet
449 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t rds2 t dacd3 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd2 t rsd2 t casd3 t casd3 t csd1 t csd1 t rwd t rwd t casd3 t rasd3 t asr t rasd3 t asc t rdh5 t dacd1 t rasd3 t rsd2 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 15.47 dram read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
450 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t don t wdh1 t dacd3 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd2 t casd3 t wcs t asc t csd1 t csd1 t rwd t rwd t casd3 t rasd3 t asr t wdd t dof t dacd1 t rasd3 t rwd t casd3 t wds note: the dackn waveform shown is for the case where active-high has been specified. figure 15.48 dram write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
451 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rdh5 t rds2 t bsd t rsd2 t casd3 t casd3 t rdh5 t rds2 t dacd3 t rsd2 t asc notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 15.49 dram burst read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
452 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t casd3 t asc t casd3 t wdd t dacd3 t wds t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.50 dram burst write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
453 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t csd1 t rr t rc1 t rc2 t re t rwd t rsd2 t casd3 t casd3 t rasd3 t rasd3 t csd1 t casd3 t rasd3 figure 15.51 dram cas-before-ras refresh cycle (trp = 1 cycle, tras = 2 cycles, pll off) .com .com .com .com 4 .com u datasheet
454 ckio t p t r t c1 t c2 t ad t bsd t rds1 t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t bsd t rsd1 t rsd1 t rsd1 t wed1 t csd1 t csd1 t rwd t rwd t wed1 t ced1 t ced1 t ced1 t dacd1 t rsd1 t oed1 t oed1 t oed1 t rdh6 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.52 pseudo-sram read cycle (pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
455 ckio t p t r t c1 t c2 t ad t bsd t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t bsd t wed1 t wed1 t wed1 t rsd1 t csd1 t csd1 t rsd1 t ced1 t ced1 t ced1 t dacd1 t wed1 t oed1 t dof t wdd t rwd t rwd t don t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.53 pseudo-sram write cycle (pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
456 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t p t pw t r t rw t c1 t c2 t w t wth t wts note: the dackn waveform shown is for the case where active-high has been specified. figure 15.54 pseudo-sram bus cycle (trp = 2 cycles, rcd = 2 cycles, 1 wait) .com .com .com .com 4 .com u datasheet
457 ckio t p t r t c1 t w t wx t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t wts t wth t wts t wth note: the dackn waveform shown is for the case where active-high has been specified. figure 15.55 pseudo-sram bus cycle (trp = 1 cycle, rcd = 1 cycle, external wait input) .com .com .com .com 4 .com u datasheet
458 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rsd1 t rsd1 t oed1 t oed1 t dacd2 t rds1 csn t bsd t rdh6 t rds1 t rdh6 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.56 pseudo-sram read cycle (static column mode, pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
459 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t wed1 t wed1 t wdd t dacd2 t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.57 pseudo-sram write cycle (static column mode, pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
460 ckio bs address t p t rr t rc1 t rc2 t re wait csn rd/ wr , we rd d31 d0 dackn wen , casxx , dqmxx ras , oe cas , oe cke t wed1 t ced1 t ced1 t oed1 t oed1 t oed1 t oed1 t wed1 figure 15.58 pseudo-sram auto-refresh cycle (pll on, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
461 ckio address wait bs csn rd/ wr , we rd wen , casxx , dqmxx dackn ras , ce cke d31 d0 cas , oe t p t rc t rc1 t rc2 t rc1 t re t wed1 t ced1 t oed1 t oed1 t oed1 t oed1 t ced1 figure 15.59 pseudo-sram self-refresh cycle (pll on, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
462 ckio address t p t r t c1 t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cke d31 d0 dackn wait cas , oe t ad t rsd2 t bsd t bsd t csd1 t rwd t ad t rsd2 t rsd2 t rdh6 t rds2 t oed2 t ced2 t as2 t ced2 t csd1 t rwd t dacd1 t dacd3 t oed2 t ced2 t oed2 t wed2 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.60 pseudo-sram read cycle (pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
463 ckio address t p t r t c1 t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cke d31 d0 dackn wait cas , oe t ad t rwd t bsd t bsd t csd1 t rwd t ad t wed2 t wdd t don t dof t wdh1 t ced2 t ced2 t as2 t ced2 t oed2 t csd1 t rwd t rsd2 t wed2 t wed2 t dacd1 t dacd3 t wdh3 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.61 pseudo-sram write cycle (pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
464 upper address lower address ckio bs csn d31 d0 csn wait wen , casxx dqmxx rd/ wr , we rd cas , oe cke ras , ce t p t r t c1 t c2 t c1 t c2 t ad t bsd t bsd t rsd2 t rsd2 t rdh6 t rds2 t oed2 t dacd1 t rds2 t rdh6 t dacd3 t oed2 note: the dackn waveform shown is for the case where active-hi g h has been specified. figure 15.62 pseudo-sram read cycle (static column mode, pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
465 upper address lower address ckio bs csn d31 d0 dackn wait wen , casxx , dqmxx rd/ wr , we rd cas , oe cke ras , ce t p t r t c1 t c2 t c1 t c2 t ad t bsd t bsd t csd1 t rwd t wed2 t dof t wdh1 t bsd t bsd t ad t wdd t wdh1 t rwd t wed2 t dacd1 t ad t dacd3 t ced2 t don t ced2 t wdd t wed2 t wdh3 t wdh3 t dacd1 t dacd3 t wed2 t csd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.63 pseudo-sram write cycle (static column mode, pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
466 ckio bs address t p t rr t rc1 t rc2 t re wait csn rd/ wr , we rd d31 d0 dackn wen , casxx , dqmxx ras , oe cas , oe cke t ced2 t ced2 t oed2 t oed2 t oed2 t oed2 figure 15.64 pseudo-sram auto-refresh cycle (pll off, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
467 ckio address wait bs csn rd/ wr , we rd wen , casxx , dqmxx dackn ras , ce cke d31 d0 cas , oe tp trc trc1 trc2 trc2 trc2 trc1 tre t ced2 t oed2 t oed2 t oed2 t oed2 t ced2 figure 15.65 pseudo-sram self-refresh cycle (pll off, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
468 ckio ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait t 1 t w t 2 t w t 2 t ad t bsd t csd1 t rwd t rsd1 t rwd t bsd t bsd t bsd t ad t ad t csd2 t rsd1 t rdh2 t rds1 t wts t wth t wts t wth t dacd1 t dacd1 t dacd2 t dacd2 t rds1 t rdh2 t wed1 t wed1 t rsd1 t rsd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.66 burst rom read cycle (pll on, 1 wait) .com .com .com .com 4 .com u datasheet
469 ckio bs a26 a0 csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait t 1 t w t 2 t w t 2 t ad t bsd t rwd t rsd2 t rwd t bsd t bsd t bsd t ad t ad t csd3 t rsd2 t rdh2 t rdh2 t rds2 t wts t wth t wts t wth t rds2 t dacd3 t dacd1 t dacd1 t dacd3 t wed2 t rsd2 t rsd2 t csd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 15.67 burst rom read cycle (pll off, 1 wait) .com .com .com .com 4 .com u datasheet
470 t1 t2 t ad t ad t ivd t rwd t ivd t rsd1 t rsd1 t rds1 ckio a4 a0 ivecf rd/ wr rd d7 d0 t rdh7 wait t wts t wth figure 15.68 interrupt vector fetch cycle (pll on, no waits) .com .com .com .com 4 .com u datasheet
471 t1 t2 t ad t ad t ivd t rwd t ivd t rsd2 t rsd2 t rds2 ckio a4 a0 ivecf rd/ wr rd d7 d0 t rdh7 wait t wts t wth figure 15.69 interrupt vector fetch cycle (pll off, no waits) .com .com .com .com 4 .com u datasheet
472 a4 a0 cki0 rd/ wr wait d7 d0 rd ivecf t 1 t w t 2 t wth t wts t wth t wts figure 15.70 interrupt vector fetch cycle (1 external wait cycle) .com .com .com .com 4 .com u datasheet
473 t asin t ahin t bss t bsh t rws t rwh ckio a26 a2 rd/ wr bs figure 15.71 address monitor cycle .com .com .com .com 4 .com u datasheet
474 15.3.4 dmac timing table 15.10 dmac timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figure dreq0, dreq1 setup time (pll off, on) t drqs 30 ns 15.72 dreq0, dreq1 setup time (pll on, 1/4 cycle delay) t drqs 30 1/4 tcyc ns dreq0, dreq1 hold time (pll off, on) t drqh 15 ns dreq0, dreq1 hold time (pll on, 1/4 cycle delay) t drqh 1/4 tcyc + 15 ns dreq0, dreq1 low level width t drqw 1.5 t cyc t drqh t drqs t drqs t drqs ckio dreq0, dreq1 level dreq0, dreq1 edge dreq0, dreq1 level cancellation figure 15.72 dreq0, dreq1 input timing .com .com .com .com 4 .com u datasheet
475 15.3.5 free-running timer timing table 15.11 free-running timer timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figure output compare output delay time (pll off, on) t tocd 160 ns 15.73 output compare output delay time (pll on, 1/4 cycle delay) t tocd 1/4 tcyc + 160 ns input capture input setup time (pll off, on) t tics 80 ns input capture input setup time (pll on, 1/4 cycle delay) t tics 80 1/4 tcyc ns timer clock input setup time (pll off, on) t tcks 80 ns 15.74 timer clock input setup time (pll on, 1/4 cycle delay) t tcks 80 1/4 tcyc ns timer clock pulse width (single edge) t tckwh 4.5 t cyc timer clock pulse width (both edges) t tckwl 8.5 t cyc t tocd t tics ckio ftoa, ftob fti figure 15.73 frt input/output timing t tcks t tckwh t tckwl ckio ftci figure 15.74 frt clock input timing .com .com .com .com 4 .com u datasheet
476 15.3.6 watchdog timer timing table 15.12 watchdog timer timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figure wdtovf delay time (pll off, on) t wovd 70 ns 15.75 wdtovf delay time (pll on, 1/4 cycle delay) t wovd 1/4 tcyc + 70 ns t wovd t wovd ckio wdtovf figure 15.75 watchdog timer output timing .com .com .com .com 4 .com u datasheet
477 15.3.7 serial communication interface timing table 15.13 serial communication interface timing (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min max unit figure input clock cycle t scyc 16 t cyc 15.76 input clock cycle (clocked synchronous mode) t scyc 24 t cyc input clock pulse width t sckw 0.4 0.6 t scyc transmit data delay time (clocked synchronous mode) t txd 70 ns 15.77 receive data setup time (clocked synchronous mode) t rxs 70 ns receive data hold time (clocked synchronous mode) t rxh 70 ns t sckw t scyc sck0 figure 15.76 input clock input/output timing t scyc t txd t rxs t rxh sck0 txd0 (transmit data) rxd0 (receive data) figure 15.77 sci input/output timing (clocked synchronous mode) .com .com .com .com 4 .com u datasheet
478 15.3.8 ac characteristics measurement conditions ? i/o signal reference level: 1.5 v ? input pulse level: v ss to 3.0 v (where res, nmi, ckio and md5-md0 are within the range v ss to v cc ) ? input rise and fall times: 1 ns v i oh i ol c l sh7604 output pin dut output v ref notes: 1. 2. c l is a total value that includes the capacitance of measurement instruments, etc., and is set as follows for each pin. 30 pf: ckio, ras , cas , cke, cs0 cs3 , breq , back , dack0, dack1, ivecf , ckpack . 50 pf: all output pins other than the above. i ol and i oh values are as shown in section 15.2, dc characteristics, and table 15.3, permitted output current values. figure 15.78 output load circuit .com .com .com .com 4 .com u datasheet
479 section 16 electrical characteristics (3v version) 16.1 absolute maximum ratings table 16.1 shows the absolute maximum ratings. table 16.1 absolute maximum ratings item symbol rating unit power supply voltage v cc ?.3 to +7.0 v input voltage vin ?.3 to v cc + 0.3 v operating temperature topr ?0 to +75 c storage temperature tstg ?5 to +125 c caution: operating the chip in excess of the absolute maximum rating may result in permanent damage. .com .com .com .com 4 .com u datasheet
480 16.2 dc characteristics tables 16.2 and 16.3 list dc characteristics. table 16.2 dc characteristics (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min typ max unit test conditions input high- res , nmi, v ih v cc 0.9 v cc + 0.3 v during standby level md5?d0 v cc 0.9 v cc + 0.3 v normal operation voltage extal, ckio v cc 0.9 v cc + 0.3 v other input pins v cc 0.7 v cc + 0.3 v input low- res , nmi, v il ?.3 v cc 0.1 v during standby level md5?d0 ?.3 v cc 0.1 v normal operation voltage other input pins ?.3 v cc 0.1 v input leak res |iin| 1.0 a vin = 0.5 to v cc ?0.5 v current nmi, md5?d0 1.0 a vin = 0.5 to v cc ?0.5 v other input pins 1.0 a vin = 0.5 to v cc ?0.5 v 3-state leak current (while off) a26?0, d31 d0, bs , cs3 cs0 , rd/ wr , ras , cas , we3 we0 , rd , ivecf |i sti | 1.0 a vin = 0.5 to v cc ?0.5 v output all output pins v oh v cc ?0.5 v i oh = ?00 a high-level voltage v cc ?1.0 v i oh = ? ma output low level voltage all output pins v ol 0.4 v i ol = 1.6 ma input res cin 15 pf vin = 0 v capaci- nmi 15 pf f = 1 mhz tance all other input pins (including d31?0) 15 pf ta = 25 c .com .com .com .com 4 .com u datasheet
481 table 16.2 dc characteristics (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) (cont) item symbol min typ max unit test conditions current normal i cc 25 30 ma f = 8 mhz consump- operation 45 55 ma f = 16 mhz tion 60 70 ma f = 28.7 mhz sleep 15 20 ma f = 8 mhz 30 40 ma f = 16 mhz 40 50 ma f = 28.7 mhz standby 1 5 a ta 50 c 20 a50 c < ta notes: 1. when no pll is used, do not leave the pllv cc and pllv ss pins open. connect pllv cc to v cc and pllv ss to v ss . 2. current consumption values shown are the values at which all output pins are without load under conditions of v ih min = v cc ?0.5 v, v il max = 0.5 v. table 16.3 permitted output current values (conditions: v cc = 5.0 v 10%, ta = ?0 to +75 c) item symbol min typ max unit output low-level permissible current (per pin) i ol 2.0 ma output low-level permissible current (total) i ol 80ma output high-level permissible current (per pin) ? oh 2.0 ma output high-level permissible current (total) (? oh )25ma caution: to ensure chip reliability, do not exceed the output current values given in table 16.3. .com .com .com .com 4 .com u datasheet
482 16.3 ac characteristics 16.3.1 clock timing table 16.4 clock timing (conditions: v cc = 3.0 to 0.5 v, ta = ?0 to +75 c) item symbol min max unit figures operating frequency f op 4 20 mhz 16.1 clock cycle time t cyc 50 143 *1 or 250 *2 ns clock high pulse width t ch 8 *1 or 15 *2 ?s clock low pulse width t cl 8 *1 or 15 *2 ?s clock rise time t cr ? ns clock fall time t cf ? ns extal clock input frequency f ex 4 8 mhz 16.2 extal clock input cycle time t excyc 125 250 ns extal clock input low level pulse width t exl 50 ns extal clock input high level pulse width t exh 50 ns extal clock input rise time t exr ? ns extal clock input clock fall time t exf ? ns power-on oscillation settling time t osc1 10 ms 16.3 software standby oscillation settling time 1 t osc2 10 ms 16.4 software standby oscillation settling time 2 t osc3 10 ms 16.5 pll synchronization settling time t pll 1 s 16.6 notes: 1. with pll circuit 1 operating. 2. with pll circuit 1 not used. t ch 1/2 v cc t cf t cr 1/2 v cc v ih ckio (input) v ih v ih v il v il t cl t cyc figure 16.1 ckio input timing .com .com .com .com 4 .com u datasheet
483 extal (input) 1/2 v cc t excyc t exl t exh t exf t exr v ih v ih v il v il v ih 1/2 v cc note: external clock input from extal pin. figure 16.2 extal clock input timing ckio, internal clock v cc v cc min res t osc1 t resw stable oscillation note: oscillation settling time when on-chip crystal oscillator is used. figure 16.3 oscillation settling time at power-on .com .com .com .com 4 .com u datasheet
484 ckio, internal clock stable oscillation standby period t osc2 t resw res note: oscillation settling time when on-chip crystal oscillator is used. figure 16.4 oscillation settling time at standby return (via res ) ckio, internal clock stable oscillation standby period t osc3 nmi note: oscillation settling time when on-chip crystal oscillator is used. figure 16.5 oscillation settling time at standby return (via nmi) .com .com .com .com 4 .com u datasheet
485 stable oscillation stable oscillation oscillation frequency modification t pll pll synchronization pll synchronization extal or ckio internal clock figure 16.6 pll synchronization settling time .com .com .com .com 4 .com u datasheet
486 16.3.2 control signal timing table 16.5 control signal timing (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure res rise, fall t resr , t resf 200 ns 16.7 res pulse width t resw 20 t cyc nmi reset setup time t nmirs tcyc + 10 ns nmi reset hold time t nmirh tcyc + 10 ns nmi rise, fall t nmir , t nmif 200 ns nmi minimum pulse width t irqes 3 tcyc res setup time * t ress 40 ns 16.8, nmi setup time * t nmis 40 ns 16.9 irl3 irl0 setup time * t irls 40 ns res hold time t resh 20 ns 16.8, nmi hold time t nmih 20 ns 16.9 irl3 irl0 hold time t irlh 20 ns brls setup time 1 (pll on) t blss1 1/2 tcyc + 20 ns 16.10 brls hold time 1 (pll on) t blsh1 15 1/2 tcyc ns bgr delay time 1 (pll on) t bgrd1 1/2 tcyc + 25 ns brls setup time 1 (pll on, 1/4 cycle delay) t blss1 1/4 tcyc + 20 ns 16.10 brls hold time 1 (pll on, 1/4 cycle delay) t blsh1 15 1/4 tcyc ns bgr delay time 1 (pll on, 1/4 cycle delay) t bgrd1 3/4 tcyc + 25 ns brls setup time 2 (pll off) t blss2 20 ns 16.11 brls hold time 2 (pll off) t blsh2 30 ns bgr delay time 2 (pll off) t bgrd2 40 ns note: the res , nmi and irl3 - irl0 signals are asynchronous inputs, but when the setup times shown here are observed, the signals are considered to have changed at clock fall. if the setup times are not observed, recognition may be delayed until the next clock fall. .com .com .com .com 4 .com u datasheet
487 table 16.5 control signal timing (cont) (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure breq delay time 1 (pll on) t brqd1 1/2 tcyc + 25 ns 16.12 back setup time 1 (pll on) t baks1 1/2 tcyc + 20 ns back hold time 1 (pll on) t bakh1 15 1/2 tcyc ns breq delay time 1 (pll on, 1/4 cycle delay) t brqd1 3/4 tcyc + 25 ns 16.12 back setup time 1 (pll on, 1/4 cycle delay) t baks1 1/4 tcyc + 20 ns back hold time 1 (pll on, 1/4 cycle delay) t bakh1 15 1/4 tcyc ns breq delay time 2 (pll off) t brqd2 40 ns 16.13 back setup time 2 (pll off) t baks2 20 ns back hold time 2 (pll off) t bakh2 30 ns bus tri-state delay time 1 (pll on) t boff1 0 35 ns 16.10, bus buffer on time 1 (pll on) t bon1 033ns 16.12 bus tri-state delay time 1 (pll on, 1/4 cycle delay) t boff1 1/4 tcyc 1/4 tcyc + 35 ns 16.10, bus buffer on time 1 (pll on, 1/4 cycle delay) t bon1 1/4 tcyc 1/4 tcyc + 33 ns 16.12 bus tri-state delay time 1 (pll off) t boff1 0 45 ns 16.11, bus buffer on time 1 (pll off) t bon1 040ns 16.13 bus tri-state delay time 2 (pll on) t boff2 1/2 tcyc 1/2 tcyc + 35 ns 16.10, bus buffer on time 2 (pll on) t bon2 1/2 tcyc 1/2 tcyc + 33 ns 16.12 bus tri-state delay time 2 (pll on, 1/4 cycle delay) t boff2 3/4 tcyc 3/4 tcyc + 35 ns 16.10, bus buffer on time 2 (pll on, 1/4 cycle delay) t bon2 3/4 tcyc 3/4 tcyc + 33 ns 16.12 bus tri-state delay time 3 (pll off) t boff3 0 45 ns 16.11, bus buffer on time 3 (pll off) t bon3 040ns 16.13 .com .com .com .com 4 .com u datasheet
488 t nmirs t resw t resf t resr t nmirh res nmi v ih v il v ih v il v ih v il v ih v il figure 16.7 reset input timing t ress ckio res t inmis nmi t irls irl3 irl0 t resh t nmih t irlh v ih v il v ih v il v ih v il figure 16.8 interrupt signal input timing (pll1 off) .com .com .com .com 4 .com u datasheet
489 ckio res t resh t ress v ih v il nmi t nmih t nmis v ih v il irl3 irl0 t irlh t irls v ih v il 1/2 t cyc or 3/4 t cyc 1/2 t cyc or 3/4 t cyc figure 16.9 interrupt signal input timing (pll1 on) t blss1 ckio brls (input) bgr (output) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 t boff2 t boff1 t blsh1 t bgrd1 t blss1 t blsh1 t bon2 t bon1 t bgrd1 figure 16.10 bus release timing (master mode, pll1 on) .com .com .com .com 4 .com u datasheet
490 a26 a0 d31 d0 rd , rd/ wr , ras , cas , csn , wen , bs , ivecf brls (input) bgr (output) t blss2 ckio t boff1 t bon1 t bon3 t boff3 t bgrd2 t bgrd2 t blsh2 t blss2 t blsh2 figure 16.11 bus release timing (master mode, pll1 off) back (input) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 breq (output) t bakh1 ckio t brqd1 t brqd1 t bakh1 t baks1 t bon2 t bon1 t boff1 t boff2 t baks1 figure 16.12 bus release timing (slave mode, pll1 on) .com .com .com .com 4 .com u datasheet
491 back (input) rd , rd/ wr , ras , cas , csn , wen , bs , ivecf a26 a0 d31 d0 breq (output) ckio t brqd2 t brqd1 t bakh2 t baks2 t bon3 t bon1 t boff1 t boff3 t bakh2 t baks2 figure 16.13 bus release timing (slave mode, pll1 off) .com .com .com .com 4 .com u datasheet
492 16.3.3 bus timing table 16.6 bus timing with pll on [mode 0, 4] (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 28 ns 16.14, 16.20, 16.40, 16.52, 16.66, 16.68 bs delay time t bsd 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 cs delay time 1 t csd1 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 cs delay time 2 t csd2 1/2 tcyc + 25 ns 16.14, 16.66 read/write delay time t rwd 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 read strobe delay time 1 t rsd1 1/2 tcyc + 25 ns 16.14, 16.40, 16.52, 16.66, 16.68 read data setup time 1 t rds1 1/2 tcyc + 10 ns 16.14, 16.40, 16.52, 16.66, 16.68 read data setup time 3 (sdram) t rds3 1/2 tcyc + 10 ns 16.20 read data hold time 2 t rdh2 0 ns 16.14, 16.66 read data hold time 4 (sdram) t rdh4 0 ns 16.20 read data hold time 5 (dram) t rdh5 0 ns 16.40 read data hold time 6 (psram) t rdh6 0 ns 16.52 read data hold time 7 (interrupt vector) t rdh7 0 ns 16.68 write enable delay time t wed1 1/2 tcyc + 3 1/2 tcyc + 25 ns 16.14, 16.15, 16.52, 16.53 write data delay time 1 t wdd 25 ns 16.15, 16.27, 16.41, 16.53 write data hold time 1 t wdh1 3 ns 16.15, 16.27, 16.41, 16.53 data buffer on time t don 25 ns 16.15, 16.27, 16.41, 16.53 data buffer off time t dof 25 ns 16.15, 16.27, 16.41, 16.53 .com .com .com .com 4 .com u datasheet
493 table 16.6 bus timing with pll on [mode 0, 4] (cont) (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures dack delay time 1 t dacd1 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 dack delay time 2 t dacd2 1/2 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 wait setup time t wts 20 ns 16.19, 16.43, 16.55, 16.66, 16.70 wait hold time t wth 10 ns 16.19, 16.43, 16.55, 16.66, 16.70 ras delay time 1 (sdram) t rasd1 25 ns 16.20 ras delay time 2 (dram) t rasd2 1/2 tcyc + 3 1/2 tcyc + 25 ns 16.40 cas delay time 1 (sdram) t casd1 25 ns 16.20 cas delay time 2 (dram) t casd2 1/2 tcyc + 3 1/2 tcyc + 25 ns 16.40 dqm delay time t dqmd 25 ns 16.20 cke delay time t cked 33 ns 16.37 ce delay time 1 t ced1 1/2 tcyc + 3 1/2 tcyc + 25 ns 16.52 oe delay time 1 t oed1 1/2 tcyc + 25 ns 16.52 ivecf delay time t ivd 25 ns 16.68 address input setup time t asin 25 ns 16.71 address input hold time t ahin 10 ns 16.71 bs input setup time t bss 25 ns 16.71 bs input hold time t bsh 10 ns 16.71 read/write input setup time t rws 25 ns 16.71 read/write input hold time t rwh 10 ns 16.71 .com .com .com .com 4 .com u datasheet
494 table 16.7 bus timing with pll on and 1/4 cycle delay [mode 1, 5] (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 1/4 tcyc + 28 ns 16.14, 16.20, 16.40, 16.52, 16.66, 16.68 bs delay time t bsd 1/4 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 cs delay time 1 t csd1 1/4 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 cs delay time 2 t csd2 3/4 tcyc + 25 ns 16.14, 16.66 read/write delay time t rwd 1/4 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 read strobe delay time 1 t rsd1 3/4 tcyc + 25 ns 16.14, 16.40, 16.52, 16.66, 16.68 read data setup time 1 t rds1 1/4 tcyc + 10 ns 16.14, 16.40, 16.52, 16.66, 16.68 read data setup time 3 (sdram) t rds3 1/4 tcyc + 10 ns 16.20 read data hold time 2 t rdh2 0 ns 16.14, 16.66 read data hold time 4 (sdram) t rdh4 0 ns 16.20 read data hold time 5 (dram) t rdh5 0 ns 16.40 read data hold time 6 (psram) t rdh6 0 ns 16.52 read data hold time 7 (interrupt vector) t rdh7 0 ns 16.68 write enable delay time t wed1 3/4 tcyc + 3 3/4 tcyc + 25 ns 16.14, 16.15, 16.52, 16.53 write data delay time 1 t wdd 1/4 tcyc + 25 ns 16.15, 16.27, 16.41, 16.53 write data hold time 1 t wdh1 1/4 tcyc + 3 ns 16.15, 16.27, 16.41, 16.53 data buffer on time t don 1/4 tcyc + 25 ns 16.15, 16.27, 16.41, 16.53 data buffer off time t dof 1/4 tcyc + 25 ns 16.15, 16.27, 16.41, 16.53 .com .com .com .com 4 .com u datasheet
495 table 16.7 bus timing with pll on and 1/4 cycle delay [mode 1, 5] (cont) (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures dack delay time 1 t dacd1 1/4 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 dack delay time 2 t dacd2 3/4 tcyc + 25 ns 16.14, 16.20, 16.40, 16.52, 16.66 wait setup time t wts 20 1/4 tcyc ns 16.19, 16.43, 16.55, 16.66, 16.70 wait hold time t wth 1/4 tcyc+10 ns 16.19, 16.43, 16.55, 16.66, 16.70 ras delay time 1 (sdram) t rasd1 1/4 tcyc + 25 ns 16.20 ras delay time 2 (dram) t rasd2 3/4 tcyc + 3 3/4 tcyc + 25 ns 16.40 cas delay time 1 (sdram) t casd1 1/4 tcyc + 25 ns 16.20 cas delay time 2 (dram) t casd2 3/4 tcyc + 3 3/4 tcyc + 25 ns 16.40 dqm delay time t dqmd 1/4 tcyc + 25 ns 16.20 cke delay time t cked 1/4 tcyc + 33 ns 16.37 ce delay time 1 t ced1 3/4 tcyc + 3 3/4 tcyc + 25 ns 16.52 oe delay time 1 t oed1 3/4 tcyc + 25 ns 16.52 ivecf delay time t ivd 1/4 tcyc + 25 ns 16.68 address input setup time t asin 25 1/4 tcyc ns 16.71 address input hold time t ahin 1/4 tcyc+10 ns 16.71 bs input setup time t bss 25 1/4 tcyc ns 16.71 bs input hold time t bsh 1/4 tcyc +10 ns 16.71 read/write input setup time t rws 25 1/4 tcyc ns 16.71 read/write input hold time t rwh 1/4 tcyc +10 ns 16.71 .com .com .com .com 4 .com u datasheet
496 table 16.8 bus timing with pll off (ckio input) [mode 6] (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 43 ns 16.16, 16.38, 16.47, 16.60, 16.67, 16.69 bs delay time t bsd 40 ns 16.16, 16.38, 16.47, 16.60, 16.67 cs delay time 1 t csd1 40 ns 16.16, 16.38, 16.47, 16.60, 16.67 cs delay time 3 t csd3 40 ns 16.16, 16.67 read write delay time t rwd 40 ns 16.16, 16.38, 16.47, 16.60, 16.67 read strobe delay time 2 t rsd2 40 ns 16.16, 16.47, 16.60, 16.67, 16.69 read data setup time 2 t rds2 10 ns 16.16, 16.38, 16.47, 16.60, 16.67, 16.69 read data hold time 2 t rdh2 0 ns 16.16, 16.67 read data hold time 3 t rdh3 30 ns 16.38 read data hold time 5 (dram) t rdh5 0 ns 16.47 read data hold time 6 (psram) t rdh6 0 ns 16.60 read data hold time 7 (interrupt vector) t rdh7 0 ns 16.69 write enable delay time 2 t wed2 40 ns 16.17, 16.61 write data delay time t wdd 40 ns 16.17, 16.39, 16.48, 16.61 write data hold time 1 t wdh1 3 ns 16.17, 16.39, 16.48, 16.61 write data hold time 2 t wdh2 5 ns 16.17 write data hold time 3 t wdh3 3 ns 16.61 dack delay time 1 t dacd1 40 ns 16.16, 16.38, 16.47, 16.60, 16.67 dack delay time 3 t dacd3 40 ns 16.16, 16.38, 16.47, 16.60, 16.67 .com .com .com .com 4 .com u datasheet
497 table 16.8 bus timing with pll off (ckio input) [mode 6] (cont) (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures wait setup time t wts 20 ns 16.19, 16.43, 16.55, 16.67, 16.70 wait hold time t wth 25 ns 16.19, 16.43, 16.55, 16.67, 16.70 ras delay time 1 (sdram) t rasd1 40 ns 16.38 ras delay time 3 (dram) t rasd3 40 ns 16.47 cas delay time 1 (sdram) t casd1 40 ns 16.38 cas delay time 3 (dram) t casd3 40 ns 16.47 dqm delay time t dqmd 40 ns 16.38 cke delay time t cked 48 ns 16.37 ce delay time 2 t ced2 40 ns 16.60 oe delay time 2 t oed2 40 ns 16.60 ivecf delay time t ivd 40 ns 16.69 we setup time t wes1 0 ns 16.16 address setup time 1 t as1 0 ns 16.17 address setup time 2 t as2 3 ns 16.60 address hold time 2 t ah2 0 ns 16.17 row address setup time t asr 3 ns 16.47 column address setup time t asc 3 ns 16.47 write command setup time t wcs 3 ns 16.48 write data setup time t wds 3 ns 16.48 address input setup time * t asin 20 ns 16.71 address input hold time * t ahin 25 ns 16.71 bs input setup time * t bss 20 ns 16.71 bs input hold time * t bsh 25 ns 16.71 read/write input setup time * t rws 20 ns 16.71 read/write input hold time * t rwh 25 ns 16.71 data buffer on time t don 40 ns 16.17, 16.39, 16.48, 16.61 data buffer off time t dof 40 ns 16.17, 16.39, 16.48, 16.61 note: when the external addresses monitor function is used, the pll must be on. .com .com .com .com 4 .com u datasheet
498 table 16.9 bus timing with pll off (ckio output) [mode 2] (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures address delay time t ad 28 ns 16.16, 16.38, 16.47, 16.60, 16.67, 16.69 bs delay time t bsd 25 ns 16.16, 16.38, 16.47, 16.60, 16.67 cs delay time 1 t csd1 25 ns 16.16, 16.38, 16.47, 16.60, 16.67 cs delay time 3 t csd3 25 ns 16.16, 16.67 read write delay time t rwd 25 ns 16.16, 16.38, 16.47, 16.60, 16.67 read strobe delay time 2 t rsd2 25 ns 16.16, 16.47, 16.60, 16.67, 16.69 read data setup time 2 t rds2 10 ns 16.16, 16.38, 16.47, 16.60, 16.67, 16.69 read data hold time 2 t rdh2 0 ns 16.16, 16.67 read data hold time 3 (sdram) t rdh3 1/2 tcyc ns 16.38 read data hold time 5 (dram) t rdh5 0 ns 16.47 read data hold time 6 (psram) t rdh6 0 ns 16.60 read data hold time 7 (interrupt vector) t rdh7 0 ns 16.69 write enable delay time 2 t wed2 3 25 ns 16.17, 16.61 write data delay time t wdd 25 ns 16.17, 16.39, 16.48, 16.61 write data hold time 1 t wdh1 3 ns 16.17, 16.39, 16.48, 16.61 write data hold time 2 t wdh2 5 ns 16.17 write data hold time 3 t wdh3 3 ns 16.61 dack delay time 1 t dacd1 25 ns 16.16, 16.38, 16.47, 16.60, 16.67 dack delay time 3 t dacd3 25 ns 16.16, 16.38, 16.47, 16.60, 16.67 .com .com .com .com 4 .com u datasheet
499 table 16.9 bus timing with pll off (ckio output) [mode 2] (cont) (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figures wait setup time t wts 20 ns 16.19, 16.43, 16.55, 16.67, 16.70 wait hold time t wth 10 ns 16.19, 16.43, 16.55, 16.67, 16.70 ras delay time 1 (sdram) t rasd1 25 ns 16.38 ras delay time 3 (dram) t rasd3 3 25 ns 16.47 cas delay time 1 (sdram) t casd1 25 ns 16.38 cas delay time 3 (dram) t casd3 3 25 ns 16.47 dqm delay time t dqmd 25 ns 16.38 cke delay time t cked 33 ns 16.37 ce delay time 2 t ced2 3 25 ns 16.60 oe delay time 2 t oed2 25 ns 16.60 ivecf delay time t ivd 25 ns 16.69 address input setup time * t asin 25 ns 16.71 address input hold time * t ahin 10 ns 16.71 bs input setup time * t bss 25 ns 16.71 bs input hold time * t bsh 10 ns 16.71 read/write input setup time * t rws 25 ns 16.71 read/write input hold time * t rwh 10 ns 16.71 data buffer on time t don 25 ns 16.17, 16.39, 16.48, 16.61 data buffer off time t dof 25 ns 16.17, 16.39, 16.48, 16.61 note: when the external addresses monitor function is used, the pll must be on. .com .com .com .com 4 .com u datasheet
500 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t wed1 t rds1 t rdh2 t wed1 t csd2 t rsd1 t rsd1 t dacd1 t dacd2 notes: 1. 2. 3. the dotted line shows the waveform when synchronous dram is connected. t rdh2 is specified from the rise of csn or rd , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 16.14 basic read cycle (no waits, pll on) .com .com .com .com 4 .com u datasheet
501 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t rsd1 t rsd1 t csd2 t wed1 t wed1 t ah1 t dacd1 t dacd2 t don t wdh1 t wdd t dof notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 16.15 basic write cycle (no waits, pll on) .com .com .com .com 4 .com u datasheet
502 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rds2 t rdh2 t csd3 t rsd2 t dacd1 t dacd3 t rwd t rsd2 t wes1 notes: 1. 2. 3. the dotted line shows the waveform when synchronous dram is connected. t rdh2 is specified from the rise of csn or rd , whichever is first. the dackn waveform shown is for the case where active-hi g h has been specified. figure 16.16 basic read cycle (no waits, pll off) .com .com .com .com 4 .com u datasheet
503 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t 1 t 2 t ad t bsd t bsd t ad t csd1 t rwd t rwd t rsd2 t rsd2 t dacd1 t dacd3 t don t wdd t as1 t csd3 t wed2 t wed2 t wdh1 t wdh2 t dof t ah2 notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 16.17 basic write cycle (no waits, pll off) .com .com .com .com 4 .com u datasheet
504 t 1 t w t 2 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t wth t wts notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 16.18 basic bus cycle (1 wait cycle) .com .com .com .com 4 .com u datasheet
505 t 1 t w t wx t 2 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait a26 a0 t wts t wth t wts t wth notes: 1. 2. the dotted line shows the waveform when synchronous dram is connected. the dackn waveform shown is for the case where active-high has been specified. figure 16.19 basic bus cycle (external wait input) .com .com .com .com 4 .com u datasheet
506 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t r t c t d1 t d2 t d3 t d4 t ad t ad t ad t ad t ad t ad t bsd t bsd t bsd t rwd t csd1 t csd1 t rwd t dqmd t rds3 t dacd2 t dacd2 t dacd2 t dacd2 t rdh4 t rds3 t rdh4 t rds3 t rdh4 t rds3 t rdh4 t dacd1 t dacd1 t rasd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t casd1 t dacd1 t dacd1 t dqmd t rsd1 notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-hi g h has been specified. figure 16.20 synchronous dram read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, bursts = 4, pll on) .com .com .com .com 4 .com u datasheet
507 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 wait upper address lower address t r t c t d1 t d2 t d3 t d4 t ad t ad t ad t bsd t bsd t bsd t bsd t rwd t csd1 t csd1 t rwd t dqmd t rds3 t rdh4 t rasd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t casd1 t dqmd t rsd1 note: the dotted line shows the waveform when synchronous dram in another cs space is accessed. figure 16.21 synchronous dram single read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, bursts = 4, pll on) .com .com .com .com 4 .com u datasheet
508 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t r t rw t c t w t d1 t d2 t d3 t d4 t bsd t rasd1 t casd1 t casd1 t rasd1 notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 16.22 synchronous dram read bus cycle (rcd = 2 cycles, cas latency = 2 cycles, bursts = 4) .com .com .com .com 4 .com u datasheet
509 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx cas , oe cke d31 d0 dackn wait ras , ce upper address lower address t nop t c t d1 t d2 t d3 t d4 t ad t bsd t rwd t csd1 t dqmd t dacd1 t rasd1 t casd1 t casd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.23 synchronous dram read bus cycle (bank active, same row access, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
510 upper address lower address bs ckio t c t w t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t dqmd note: the dackn waveform shown is for the case where active-high has been specified. figure 16.24 synchronous dram read bus cycle (bank active, same row access, cas latency = 2 cycles) .com .com .com .com 4 .com u datasheet
511 upper address lower address bs ckio t p t r t c t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t bsd t csd1 t rwd t rwd t dacd1 t rasd1 t rasd1 t dqmd note: the dackn waveform shown is for the case where active-high has been specified. figure 16.25 synchronous dram read bus cycle (bank active, different row access, trp = 1 cycle, rcd = 1 cycle, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
512 upper address lower address bs ckio t p t pw t r t c t d1 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rwd t rasd1 t rasd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.26 synchronous dram read bus cycle (bank active, different row access, trp = 2 cycles, rcd = 1 cycle, cas latency = 1 cycle) .com .com .com .com 4 .com u datasheet
513 ckio t r t c t ap upper address wen casxx dqmxx d31 d0 lower address bs csn rd rd/ wr we dackn wait ras ce cas oe cke t ad t ad t ad t bsd t csd1 t rwd t dqmd t dacd1 t rasd1 t rasd1 t casd1 t casd1 t casd1 t rasd1 t rasd1 t dqmd t dacd1 t dacd2 t don t wdd t rwd t rwd t rsd1 t csd1 t csd1 t bsd t bsd t wdh1 notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. t dof figure 16.27 synchronous dram write bus cycle (rcd = 1 cycle, trwl = 1 cycle, pll on) .com .com .com .com 4 .com u datasheet
514 tr trw tc trwl tap ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rasd1 t casd1 t rasd1 t dacd1 t csd1 notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 16.28 synchronous dram write bus cycle (rcd = 2 cycles, trwl = 2 cycles) .com .com .com .com 4 .com u datasheet
515 tc ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t bsd t bsd t csd1 t csd1 t rwd t rwd t dqmd t dqmd t wdd t dof t wdh1 t don t dacd2 t dacd1 t rasd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.29 synchronous dram write bus cycle (bank active, same row access) .com .com .com .com 4 .com u datasheet
516 tc ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad tc t dqmd t wdd t wdh1 t dacd2 t dacd1 t casd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.30 synchronous dram consecutive write cycles (bank active, same row access) .com .com .com .com 4 .com u datasheet
517 ckio upper address lower address bs csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad tp tr tc t bsd t csd1 t rwd t rwd t dqmd t dqmd t dacd1 t rasd1 t casd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.31 synchronous dram write bus cycle (bank active, different row access, trp = 1 cycle, rcd = 1 cycle) .com .com .com .com 4 .com u datasheet
518 upper address lower address bs ckio tp t pw t r t rw t c csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t rwd t dqmd t rasd1 t rasd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.32 synchronous dram write bus cycle (bank active, different row access, trp = 2 cycles, rcd = 2 cycles) .com .com .com .com 4 .com u datasheet
519 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t p t mw t ad t bsd t ad lower address t ad t csd1 t rwd t rwd t dqmd t csd1 t csd1 t rasd1 t rasd1 t rasd1 t csd1 t csd1 t bsd figure 16.33 synchronous dram mode register write cycle (trp = 1 cycle) .com .com .com .com 4 .com u datasheet
520 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t p t pw t mw lower address t rwd t rwd t rasd1 t rasd1 figure 16.34 synchronous dram mode register write cycle (trp = 2 cycles) .com .com .com .com 4 .com u datasheet
521 ckio bs csn rd rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t rr t rc1 t re t nop t rc2 lower address t rasd1 t rasd1 t rasd1 t casd1 t casd1 t ad t ad t csd1 t rwd t rwd t bsd t csd1 note: a precharge cycle always precedes the auto-refresh cycle by the number of cycles specified by trp. figure 16.35 synchronous dram auto-refresh cycle (tras = 2 cycles) .com .com .com .com 4 .com u datasheet
522 ckio bs rd csn rd/ wr , we wen , casxx , dqmxx ras , ce cas , oe d31 d0 dackn wait upper address t p t rr t rc2 t re t nop t rc1 lower address cke t rasd1 t casd1 t ad t ad t bsd t csd1 t rwd t rwd figure 16.36 synchronous dram auto-refresh cycle (shown from precharge cycle, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
523 upper address lower address bs ckio trr t rc1 t rc2 t re t rc1 csn rd/ wr we wen casxx dqmxx d31 d0 dackn rd wait ras ce cas oe cke note: a precharge cycle always preceds the self-refresh cycle by the number of cycles specified by trp. t ad t rwd t ad t rasd1 t casd1 t cked t cked t rasd1 t csd1 t csd1 t re t nap t rasd1 t casd1 figure 16.37 synchronous dram self-refresh cycle (tras = 2) .com .com .com .com 4 .com u datasheet
524 upper address lower address bs ckio tr t c t d1 t d2 t d3 t d4 csn rd/ wr we rd wen casxx dqmxx d31 d0 dackn wait ras ce cas oe cke t ad t ad t ad t ad t ad t ad t bsd t rasd1 t rasd1 t rasd1 t casd1 t csd1 t rwd t dqmd t rds2 t dacd1 t dqmd t rwd t bsd t casd1 t casd1 t casd1 t rsd2 t rds2 t rdh3 t rdh3 t rdh3 t rdh3 t rds2 t rds2 t dacd3 t dacd3 t dacd1 t dacd1 t dacd3 t dacd3 t dacd1 t csd1 t bsd notes: 1. 2. the dotted line shows the waveform when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 16.38 synchronous dram read bus cycle (rcd = 1 cycle, cas latency = 1 cycle, trp = 1 cycle, bursts = 4, pll off) .com .com .com .com 4 .com u datasheet
525 ckio t r t c t ap upper address lower address wen casxx dqmxx bs csn rd/ wr we rd d31 d0 dackn wait ras ce cas oe cke t wdd t don t dacd3 t wdh1 t dof notes: 1. 2. dotted lines show the waveforms when synchronous dram in another cs space is accessed. the dackn waveform shown is for the case where active-high has been specified. figure 16.39 synchronous dram write bus cycle (rcd = 1 cycle, trwl = 1 cycle, pll off) .com .com .com .com 4 .com u datasheet
526 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t rds1 t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd1 t rsd1 t casd2 t casd2 t csd1 t csd1 t rwd t rwd t casd2 t rasd2 t rasd2 t rasd2 t rdh5 t dacd1 t rsd1 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 16.40 dram read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
527 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t casd2 t casd2 t csd1 t csd1 t rwd t rwd t casd2 t rasd2 t rasd2 t rasd2 t dacd1 t rsd1 t rwd t don t wdh1 t wdd t dof note: the dackn waveform shown is for the case where active-high has been specified. figure 16.41 dram write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
528 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t pw t r t rw t c1 t c2 t w t wth t wts note: the dackn waveform shown is for the case where active-hi g h has been specified. figure 16.42 dram bus cycle (trp = 2 cycles, rcd = 2 cycles, 1 wait) .com .com .com .com 4 .com u datasheet
529 ckio t p t r t c1 t w t wx t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t wts t wth t wts t wth note: the dackn waveform shown is for the case where active-high has been specified. figure 16.43 dram bus cycle (trp = 1 cycle, rcd = 1 cycle, external wait input) .com .com .com .com 4 .com u datasheet
530 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rsd1 t rsd1 t casd2 t casd2 t dacd2 t rds1 csn t bsd t rdh5 t rds1 t rdh5 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 16.44 dram burst read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
531 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas oe cke d31 d0 dackn wait upper address lower address t wdh1 t bsd t casd2 t casd2 t wdd t dacd2 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.45 dram burst write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll on) .com .com .com .com 4 .com u datasheet
532 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t csd1 t rr t rc1 t rc2 t re t casd2 t casd2 t casd2 t rasd2 t rasd2 t rasd2 t csd1 figure 16.46 dram cas-before-ras refresh cycle (trp = 1 cycle, tras = 2 cycles, pll on) .com .com .com .com 4 .com u datasheet
533 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t rds2 t dacd3 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd2 t rsd2 t casd3 t casd3 t csd1 t csd1 t rwd t rwd t casd3 t rasd3 t asr t rasd3 t asc t rdh5 t dacd1 t rasd3 t rsd2 notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 16.47 dram read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
534 ckio t p t r t c1 t c2 t ad t ad t bsd t bsd t don t wdh1 t dacd3 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t rsd2 t casd3 t wcs t asc t csd1 t csd1 t rwd t rwd t casd3 t rasd3 t asr t wdd t dof t dacd1 t rasd3 t rwd t casd3 t wds note: the dackn waveform shown is for the case where active-high has been specified. figure 16.48 dram write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
535 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rdh5 t rds2 t bsd t rsd2 t casd3 t casd3 t rdh5 t rds2 t dacd3 t rsd2 t asc notes: 1. 2. t rdh5 is specified from the rise of rd or casxx , whichever is first. the dackn waveform shown is for the case where active-high has been specified. figure 16.49 dram burst read cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
536 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t casd3 t asc t casd3 t wdd t dacd3 t wds t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.50 dram burst write cycle (trp = 1 cycle, rcd = 1 cycle, no waits, pll off) .com .com .com .com 4 .com u datasheet
537 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t p t csd1 t rr t rc1 t rc2 t re t rwd t rsd2 t casd3 t casd3 t rasd3 t rasd3 t csd1 t casd3 t rasd3 figure 16.51 dram cas-before-ras refresh cycle (trp = 1 cycle, tras = 2 cycles, pll off) .com .com .com .com 4 .com u datasheet
538 ckio t p t r t c1 t c2 t ad t bsd t rds1 t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address t bsd t rsd1 t rsd1 t rsd1 t wed1 t csd1 t csd1 t rwd t rwd t wed1 t ced1 t ced1 t ced1 t dacd1 t rsd1 t oed1 t oed1 t oed1 t rdh6 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.52 pseudo-sram read cycle (pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
539 ckio t p t r t c1 t c2 t ad t bsd t dacd2 t ad bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t bsd t wed1 t wed1 t wed1 t rsd1 t csd1 t csd1 t rsd1 t ced1 t ced1 t ced1 t dacd1 t wed1 t oed1 t dof t wdd t rwd t rwd t don t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.53 pseudo-sram write cycle (pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
540 ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t p t pw t r t rw t c1 t c2 t w t wth t wts note: the dackn waveform shown is for the case where active-high has been specified. figure 16.54 pseudo-sram bus cycle (trp = 2 cycles, rcd = 2 cycles, 1 wait) .com .com .com .com 4 .com u datasheet
541 ckio t p t r t c1 t w t wx t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait address t wts t wth t wts t wth note: the dackn waveform shown is for the case where active-high has been specified. figure 16.55 pseudo-sram bus cycle (trp = 1 cycle, rcd = 1 cycle, external wait input) .com .com .com .com 4 .com u datasheet
542 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t rsd1 t rsd1 t oed1 t oed1 t dacd2 t rds1 csn t bsd t rdh6 t rds1 t rdh6 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.56 pseudo-sram read cycle (static column mode, pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
543 ckio t p t r t c1 t c2 t c1 t c2 t ad t bsd t dacd1 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait upper address lower address t bsd t wed1 t wed1 t wdd t dacd2 t wdh1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.57 pseudo-sram write cycle (static column mode, pll on, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
544 ckio bs address t p t rr t rc1 t rc2 t re wait csn rd/ wr , we rd d31 d0 dackn wen , casxx , dqmxx ras , oe cas , oe cke t wed1 t ced1 t ced1 t oed1 t oed1 t oed1 t oed1 t wed1 figure 16.58 pseudo-sram auto-refresh cycle (pll on, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
545 ckio address wait bs csn rd/ wr , we rd wen , casxx , dqmxx dackn ras , ce cke d31 d0 cas , oe t p t rc t rc1 t rc2 t rc1 t re t wed1 t ced1 t oed1 t oed1 t oed1 t oed1 t ced1 figure 16.59 pseudo-sram self-refresh cycle (pll on, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
546 ckio address t p t r t c1 t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cke d31 d0 dackn wait cas , oe t ad t rsd2 t bsd t bsd t csd1 t rwd t ad t rsd2 t rsd2 t rdh6 t rds2 t oed2 t ced2 t as2 t ced2 t csd1 t rwd t dacd1 t dacd3 t oed2 t ced2 t oed2 t wed2 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.60 pseudo-sram read cycle (pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
547 ckio address t p t r t c1 t c2 bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cke d31 d0 dackn wait cas , oe t ad t rwd t bsd t bsd t csd1 t rwd t ad t wed2 t wdd t don t dof t wdh1 t ced2 t ced2 t as2 t ced2 t oed2 t csd1 t rwd t rsd2 t wed2 t wed2 t dacd1 t dacd3 t wdh3 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.61 pseudo-sram write cycle (pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
548 upper address lower address ckio bs csn d31 d0 csn wait wen , casxx dqmxx rd/ wr , we rd cas , oe cke ras , ce t p t r t c1 t c2 t c1 t c2 t ad t bsd t bsd t rsd2 t rsd2 t rdh6 t rds2 t oed2 t dacd1 t rds2 t rdh6 t dacd3 t oed2 note: the dackn waveform shown is for the case where active-hi g h has been specified. figure 16.62 pseudo-sram read cycle (static column mode, pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
549 upper address lower address ckio bs csn d31 d0 dackn wait wen , casxx , dqmxx rd/ wr , we rd cas , oe cke ras , ce t p t r t c1 t c2 t c1 t c2 t ad t bsd t bsd t csd1 t rwd t wed2 t dof t wdh1 t bsd t bsd t ad t wdd t wdh1 t rwd t wed2 t dacd1 t ad t dacd3 t ced2 t don t ced2 t wdd t wed2 t wdh3 t wdh3 t dacd1 t dacd3 t wed2 t csd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.63 pseudo-sram write cycle (static column mode, pll off, trp = 1 cycle, rcd = 1 cycle, no waits) .com .com .com .com 4 .com u datasheet
550 ckio bs address t p t rr t rc1 t rc2 t re wait csn rd/ wr , we rd d31 d0 dackn wen , casxx , dqmxx ras , oe cas , oe cke t ced2 t ced2 t oed2 t oed2 t oed2 t oed2 figure 16.64 pseudo-sram auto-refresh cycle (pll off, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
551 ckio address wait bs csn rd/ wr , we rd wen , casxx , dqmxx dackn ras , ce cke d31 d0 cas , oe tp trc trc1 trc2 trc2 trc2 trc1 tre t ced2 t oed2 t oed2 t oed2 t oed2 t ced2 figure 16.65 pseudo-sram self-refresh cycle (pll off, trp = 1 cycle, tras = 2 cycles) .com .com .com .com 4 .com u datasheet
552 ckio ckio bs csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait t 1 t w t 2 t w t 2 t ad t bsd t csd1 t rwd t rsd1 t rwd t bsd t bsd t bsd t ad t ad t csd2 t rsd1 t rdh2 t rds1 t wts t wth t wts t wth t dacd1 t dacd1 t dacd2 t dacd2 t rds1 t rdh2 t wed1 t wed1 t rsd1 t rsd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.66 burst rom read cycle (pll on, 1 wait) .com .com .com .com 4 .com u datasheet
553 ckio bs a26 a0 csn rd/ wr , we rd wen , casxx , dqmxx ras , ce cas , oe cke d31 d0 dackn wait t 1 t w t 2 t w t 2 t ad t bsd t rwd t rsd2 t rwd t bsd t bsd t bsd t ad t ad t csd3 t rsd2 t rdh2 t rdh2 t rds2 t wts t wth t wts t wth t rds2 t dacd3 t dacd1 t dacd1 t dacd3 t wed2 t rsd2 t rsd2 t csd1 note: the dackn waveform shown is for the case where active-high has been specified. figure 16.67 burst rom read cycle (pll off, 1 wait) .com .com .com .com 4 .com u datasheet
554 t1 t2 t ad t ad t ivd t rwd t ivd t rsd1 t rsd1 t rds1 ckio a4 a0 ivecf rd/ wr rd d7 d0 t rdh7 wait t wts t wth figure 16.68 interrupt vector fetch cycle (pll on, no waits) .com .com .com .com 4 .com u datasheet
555 t1 t2 t ad t ad t ivd t rwd t ivd t rsd2 t rsd2 t rds2 ckio a4 a0 ivecf rd/ wr rd d7 d0 t rdh7 wait t wts t wth figure 16.69 interrupt vector fetch cycle (pll off, no waits) .com .com .com .com 4 .com u datasheet
556 a4 a0 cki0 rd/ wr wait d7 d0 rd ivecf t 1 t w t 2 t wth t wts t wth t wts figure 16.70 interrupt vector fetch cycle (1 external wait cycle) .com .com .com .com 4 .com u datasheet
557 t asin t ahin t bss t bsh t rws t rwh ckio a26 a2 rd/ wr bs figure 16.71 address monitor cycle .com .com .com .com 4 .com u datasheet
558 16.3.4 dmac timing table 16.10 dmac timing (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure dreq0, dreq1 setup time (pll off, on) t drqs 50 ns 16.72 dreq0, dreq1 setup time (pll on, 1/4 cycle delay) t drqs 50 1/4 tcyc ns dreq0, dreq1 hold time (pll off, on) t drqh 50 ns dreq0, dreq1 hold time (pll on, 1/4 cycle delay) t drqh 1/4 tcyc + 50 ns dreq0, dreq1 low level width t drqw 1.5 t cyc t drqh t drqs t drqs t drqs ckio dreq0, dreq1 level dreq0, dreq1 edge dreq0, dreq1 level cancellation figure 16.72 dreq0, dreq1 input timing .com .com .com .com 4 .com u datasheet
559 16.3.5 free-running timer timing table 16.11 free-running timer timing (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure output compare output delay time (pll off, on) t tocd 320 ns 16.73 output compare output delay time (pll on, 1/4 cycle delay) t tocd 1/4 tcyc + 320 ns input capture input setup time (pll off, on) t tics 80 ns input capture input setup time (pll on, 1/4 cycle delay) t tics 80 1/4 tcyc ns timer clock input setup time (pll off, on) t tcks 80 ns 16.74 timer clock input setup time (pll on, 1/4 cycle delay) t tcks 80 1/4 tcyc ns timer clock pulse width (single edge) t tckwh 4.5 t cyc timer clock pulse width (both edges) t tckwl 8.5 t cyc t tocd t tics ckio ftoa, ftob fti figure 16.73 frt input/output timing t tcks t tckwh t tckwl ckio ftci figure 16.74 frt clock input timing .com .com .com .com 4 .com u datasheet
560 16.3.6 watchdog timer timing table 16.12 watchdog timer timing (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure wdtovf delay time (pll off, on) t wovd 70 ns 16.75 wdtovf delay time (pll on, 1/4 cycle delay) t wovd 1/4 tcyc + 70 ns t wovd t wovd ckio wdtovf figure 16.75 watchdog timer output timing .com .com .com .com 4 .com u datasheet
561 16.3.7 serial communication interface timing table 16.13 serial communication interface timing (conditions: v cc = 3.0 to 5.5 v, ta = ?0 to +75 c) item symbol min max unit figure input clock cycle t scyc 16 t cyc 16.76 input clock cycle (clocked synchronous mode) t scyc 24 t cyc input clock pulse width t sckw 0.4 0.6 t scyc transmission data delay time (clocked synchronous mode) t txd 70 ns 16.77 receive data setup time (clocked synchronous mode) t rxs 70 ns receive data hold time (clocked synchronous mode) t rxh 70 ns t sckw t scyc sck0 figure 16.76 input clock input/output timing t scyc t txd t rxs t rxh sck0 txd0 (transmit data) rxd0 (receive data) figure 16.77 sci input/output timing (clocked synchronous mode) .com .com .com .com 4 .com u datasheet
562 16.3.8 ac characteristics measurement conditions ? i/o signal reference level: 1.5 v ? input pulse level: v ss to 3.0 v (where res, nmi, ckio and md5-md0 are within the range v ss to v cc ) ? input rise and fall times: 1 ns v i oh i ol c l sh7604 output pin dut output v ref notes: 1. 2. c l is a total value that includes the capacitance of measurement instruments, etc., and is set as follows for each pin. 30 pf: ckio, ras , cas , cke, cs0 cs3 , breq , back , dack0, dack1, ivecf , ckpack . 50 pf: all output pins other than the above. i ol and i oh values are as shown in section 16.2, dc characteristics, and table 16.3, permitted output current values. figure 16.78 output load circuit .com .com .com .com 4 .com u datasheet
563 appendix a pin states table a.1 pin states during resets, power-down state, and bus-released state pin states reset power-on reset manual power-down modes bus- category pin master slave bus acquired bus released standby sleep released mode clock ckio io *1 io *1 io *1 io *1 io *1 io *1 io *1 extal i *1 i *1 i *1 i *1 i *1 i *1 i *1 xtal o *1 o *1 o *1 o *1 o *1 o *1 o *1 ckpreq zz i i i ii ckpack hh h h h *2 hh system control reset ii i i i ii wdtovf hh h h o oo back , brls zz i i z ii breq, bgr hh o o h oo md5?d0 i i i i i i i interrupt nmi i i i i i i i irl3 irl0 zz z z i ii ivecf hh h h h *3 hh address bus a26?0 o z o z z o z *4 data bus d31?0 z z io z z z z bus control cs3 cs0 hz o z h hz *4 bs hz o z h hz rd/ wr hz o z h hz *4 ras, ce hz o z h hz cas , oe hz o z h hz cashh , dqmuu h z o z h h z cashl , dqmul h z o z h h z caslh , dqmlu h z o z h h z casll , dqmll h z o z h h z rd hz o z h hz cke h h o h o o h wait z z i z z i ignored .com .com .com .com 4 .com u datasheet
564 table a.1 pin states during resets, power-down state, and bus-released state (cont) pin states reset power-on reset manual power-down modes bus- category pin master slave bus acquired bus released standby sleep released mode direct memory dack0, dack1 h h h h k *3 oo access controller (dmac) dreq0, dreq1 z z z z z i i 16-bit free- ftoa l l l l k *3 oo running timer ftob l l l l k *3 oo (frt) fti z z z z k *3 ii ftci z z z z k *3 ii serial rxd z z z z k *3 ii communication txd h h h h k *3 oo interface (sci) sck z z z z k *3 io i i: input o: output h: high-level output l: low-level output z: high impedance k: input pins are high impedance, output pins retain their state notes: 1. depends on the clock mode (md2?d0 setting). 2. low-level output in standby mode when the clock is paused. 3. when the high impedance bit (hiz) in the standby control register (sbycr) is set to 1, output pins become high impedance. 4. input when the external bus cycle address monitor function is used. other: in sleep mode, if the dmac is running, the address/data bus and bus control signals change according to the dmac operation (the same applies during refreshing). .com .com .com .com 4 .com u datasheet
565 appendix b list of registers b.1 list of i/o registers abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'fffffe00 smr c/ a chr pe o/ e stop mp cks1 cks0 sci h'fffffe01 brr h'fffffe02 scr tie rie te re mpie teie cke1 cke0 h'fffffe03 tdr h'fffffe04 ssr tdre rdrf orer fer per tend mpb mpbt h'fffffe05 rdr h'fffffe06 to h'fffffe09 h'fffffe10 tier icie ociae ocibe ovie frt h'fffffe11 ftcsr icf ocfa ocfb ovf cclra h'fffffe12 frc h'fffffe13 ocra/b h'fffffe14 h'fffffe15 tcr h'fffffe16 iedga cks1 cks0 h'fffffe17 tocr ocrs olvla olvlb h'fffffe18 ficr h'fffffe19 h'fffffe20 to h'fffffe59 h'fffffe60 iprb sciip3 sciip2 sciip1 sciip0 frtip3 frtip2 frtip1 frtip0 intc h'fffffe61 h'fffffe62 vcra serv6 serv5 serv4 serv3 serv2 serv1 serv0 h'fffffe63 srxv6 srxv5 srxv4 srxv3 srxv2 srxv1 srxv0 h'fffffe64 vcrb stxv6 stxv5 stxv4 stxv3 stxv2 stxv1 stxv0 h'fffffe65 stev6 stev5 stev4 stev3 stev2 stev1 stev0 .com .com .com .com 4 .com u datasheet
566 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'fffffe66 vcrc ficv6 ficv5 ficv4 ficv3 ficv2 ficv1 ficv0 intc h'fffffe67 focv6 focv5 focv4 focv3 focv2 focv1 focv0 h'fffffe68 vcrd fovv6 fovv5 fovv4 fovv3 fovv2 fovv1 fovv0 h'fffffe69 h'fffffe6a to h'fffffe70 h'fffffe71 drcr0 rs1rs0 dmac (channel 0) h'fffffe72 drcr1 rs1rs0 dmac (channel 1) h'fffffe73 to h'fffffe7f h'fffffe80 wtcsr* ovf wt/ it tme ? cks2 cks1 cks0 wdt h'fffffe81 wtcnt* h'fffffe82 h'fffffe83 rstcsr* wovf rste rsts h'fffffe84 to h'fffffe90 h'fffffe91 sbycr sby hiz mstp4 mstp3 mstp2 mstp1 mstp0 power- down h'fffffe92 ccr w1 w0 cp tw oc id ce cache h'fffffe93 to h'fffffe9f note: address for reading. when writing, the address is h'fffffe80 for wtcsr and wtcnt, and h'fffffe82 for rstcsr. see section 12.2.4, register access, in section 12, watchdog timer (wdt), for more information. .com .com .com .com 4 .com u datasheet
567 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'fffffee0 icr nimil nimie intc h'fffffee1 vecmd h'fffffee2 ipra divuip3 divuip2 divuip1 divuip0 dmaci3 dmaci2 dmaci1 dmaci0 h'fffffee3 wdtip3 wdtip2 wdtip1 wdtip0 h'fffffee4 vcrwdt witv6 witv5 witv4 witv3 witv2 witv1 witv0 h'fffffee5 bcmv6 bcmv5 bcmv4 bcmv3 bcmv2 bcmv1 bcmv0 h'fffffee6 to h'fffffeff h'ffffff00 dvsr divu h'ffffff01 h'ffffff02 h'ffffff03 h'ffffff04 dvdnt h'ffffff05 h'ffffff06 h'ffffff07 h'ffffff08 dvcr h'ffffff09 h'ffffff0a h'ffffff0b ovfie ovf h'ffffff0c vcrdiv h'ffffff0d h'ffffff0e h'ffffff0f h'ffffff10 dvdnth h'ffffff11 h'ffffff12 h'ffffff13 .com .com .com .com 4 .com u datasheet
568 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffffff14 dvdntl divu h'ffffff15 h'ffffff16 h'ffffff17 h'ffffff18 to h'ffffff3f h'ffffff40 barah baa31 baa30 baa29 baa28 baa27 baa26 baa25 baa24 ubc h'ffffff41 baa23 baa22 baa21 baa20 baa19 baa18 baa17 baa16 (channel a) h'ffffff42 baral baa15 baa14 baa13 baa12 baa11 baa10 baa9 baa8 h'ffffff43 baa7 baa6 baa5 baa4 baa3 baa2 baa1 baa0 h'ffffff44 bamrah bama31 bama30 bama29 bama28 bama27 bama26 bama25 bama24 h'ffffff45 bama23 bama22 bama21 bama20 bama19 bama18 bama17 bama16 h'ffffff46 bamral bama15 bama14 bama13 bama12 bama11 bama10 bama9 bama8 h'ffffff47 bama7 bama6 bama5 bama4 bama3 bama2 bama1 bama0 h'ffffff48 bbra h'ffffff49 cpa1 cpa0 ida1 ida0 rwa1 rwa0 sza1 sza0 h'ffffff4a to h'ffffff5f h'ffffff60 barbh bab31 bab30 bab29 bab28 bab27 bab26 bab25 bab24 ubc h'ffffff61 bab23 bab22 bab21 bab20 bab19 bab18 bab17 bab16 (channel b) h'ffffff62 barbl bab15 bab14 bab13 bab12 bab11 bab10 bab9 bab8 h'ffffff63 bab7 bab6 bab5 bab4 bab3 bab2 bab1 bab0 h'ffffff64 bamrbh bamb31 bamb30 bamb29 bamb28 bamb27 bamb26 bamb25 bamb24 h'ffffff65 bamb23 bamb22 bamb21 bamb20 bamb19 bamb18 bamb17 bamb16 .com .com .com .com 4 .com u datasheet
569 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffffff66 bamrbl bamb15 bamb14 bamb13 bamb12 bamb11 bamb10 bamb9 bamb8 ubc h'ffffff67 bamb7 bamb6 bamb5 bamb4 bamb3 bamb2 bamb1 bamb0 (channel b) h'ffffff68 bbrb h'ffffff69 cpb1 cpb0 idb1 idb0 rwb1 rwb0 szb1 szb0 h'ffffff6a to h'ffffff6f h'ffffff70 bdrbh bdb31 bdb30 bdb29 bdb28 bdb27 bdb26 bdb25 bdb24 h'ffffff71 bdb23 bdb22 bdb21 bdb20 bdb19 bdb18 bdb17 bdb16 h'ffffff72 bdrbl bdb15 bdb14 bdb13 bdb12 bdb11 bdb10 bdb9 bdb8 h'ffffff73 bdb7 bdb6 bdb5 bdb4 bdb3 bdb2 bdb1 bdb0 h'ffffff74 bdmrbh bdmb31 bdmb30 bdmb29 bdmb28 bdmb27 bdmb26 bdmb25 bdmb24 h'ffffff75 bdmb23 bdmb22 bdmb21 bdmb20 bdmb19 bdmb18 bdmb17 bdmb16 h'ffffff76 bdmrbl bdmb15 bdmb14 bdmb13 bdmb12 bdmb11 bdmb10 bdmb9 bdmb8 h'ffffff77 bdmb7 bdmb6 bdmb5 bdmb4 bdmb3 bdmb2 bdmb1 bdmb0 h'ffffff78 brcr cmfca cmfpa ebbe umd pcba h'ffffff79 cmfcb cmfpb seq dbeb pcbb h'ffffff7a to h'ffffff7f .com .com .com .com 4 .com u datasheet
570 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffffff80 sar0 dmac h'ffffff81 (channel 0) h'ffffff82 h'ffffff83 h'ffffff84 dar0 h'ffffff85 h'ffffff86 h'ffffff87 h'ffffff88 tcr0 h'ffffff89 h'ffffff8a h'ffffff8b h'ffffff8c chcr0 h'ffffff8d h'ffffff8e dm1 dm0 sm1 sm0 ts1 ts0 ar am h'ffffff8f al ds dl tb ta ie te de h'ffffff90 sar1 dmac h'ffffff91 (channel 1) h'ffffff92 h'ffffff93 h'ffffff94 dar1 h'ffffff95 h'ffffff96 h'ffffff97 h'ffffff98 tcr1 h'ffffff99 h'ffffff9a h'ffffff9b .com .com .com .com 4 .com u datasheet
571 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffffff9c chcr1 dmac h'ffffff9d (channel 1) h'ffffff9e dm1 md0 sm1 sm0 ts1 ts0 ar am h'ffffff9f al ds dl tb ta ie te de h'ffffffa0 vcrma0 dmac h'ffffffa1 (channel 0) h'ffffffa2 h'ffffffa3 vc7 vc6 vc5 vc4 vc3 vc2 vc1 vc0 h'ffffffa4 to h'ffffffa7 h'ffffffa8 vcrdma1 dmac h'ffffffa9 (channel 1) h'ffffffaa h'ffffffab vc7 vc6 vc5 vc4 vc3 vc2 vc1 vc0 h'ffffffac to h'ffffffaf h'ffffffb0 dmaor dmac h'ffffffb1 (channels h'ffffffb2 0 and 1) h'ffffffb3 prae nmif dme h'ffffffb4 to h'ffffffdf .com .com .com .com 4 .com u datasheet
572 abbrevia- tion of bit name address register bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffffffe0 bsc h'ffffffe1 h'ffffffe2 bcr1 mastr endian bstrom pshr ahlw1 ahlw0 h'ffffffe3 a1lw1 a1lw0 a0lw1 a0lw0 dram2 dram1 dram0 h'ffffffe4 bcr2 h'ffffffe5 h'ffffffe6 h'ffffffe7 a3sz1 a3sz0 a2sz1 a2sz0 a1sz1 a1sz0 h'ffffffe8 wcr h'ffffffe9 h'ffffffea iw31 iw30 iw20 iw21 iw10 iw11 iw01 iw00 h'ffffffeb w31 w30 w20 w21 w10 w11 w01 w00 h'ffffffec mcr h'ffffffed h'ffffffee trp rcd trwl tras1 trs0 be rasd h'ffffffef amx2 sz amx1 amx0 rfsh rmd h'fffffff0 rtcsr h'fffffff1 h'fffffff2 h'fffffff3 cmf cmie cks2 cks1 cks0 h'fffffff4 rtcnt h'fffffff5 h'fffffff6 h'fffffff7 h'fffffff8 rtcor h'fffffff9 h'fffffffa h'fffffffb h'fffffffc to h'ffffffff .com .com .com .com 4 .com u datasheet
573 b.2 register chart register overview serial mode register (smr) h'fffffe00 8 register name (abbreviation) sci module access size start address bit name initial value r/w item 7 c/ a 0 r/w 6 chr 0 r/w 5 pe 0 r/w 4 o/ e 0 r/w 3 stop 0 r/w 2 mp 0 r/w 1 cks1 0 r/w 0 cks0 0 r/w bit 7 6 5 4 3 2 1 0 bit bit name communication mode (c/ a ) character length (chr) parity enable (pe) parity mode (o e ) stop bit length (stop) multiprocessor mode (mp) clock select 1 and 0 (cks1, cks0) value 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 description asynchronous mode (initial value) clocked synchronous mode eight-bit data (initial value) seven-bit data parity bit not added or checked (initial value) parity bit added and checked even parity (initial value) odd parity one stop bit (initial value) two stop bits multiprocessor function disabled (initial value) multiprocessor format selected /4 (initial value) /16 /64 /256 bit function bit value (when there is a set of bits, the upper bit is on the left, and the lower bit on the right.) bit number bit name (abbreviation) bit description .com .com .com .com 4 .com u datasheet
574 sci serial mode register (smr) h'fffffe00 8 bit item 7 6 5 4 3 2 1 0 bit name c/ a chr pe o/e stop mp cks1 cks0 initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 communication mode 0 asynchronous mode (initial value) (c/a) 1 clocked synchronous mode 6 character length 0 eight-bit data (initial value) (chr) 1 seven-bit data 5 parity enable 0 parity bit not added or checked (initial value) (pe) 1 parity bit added and checked 4 parity mode 0 even parity (initial value) (oe) 1 odd parity 3 stop bit length 0 one stop bit (initial value) (stop) 1 two stop bits 2 multiprocessor mode 0 multiprocessor function disabled (initial value) (mp) 1 multiprocessor format selected 1 clock select 1 and 0 0 0 /4 (initial value) (cks1, cks0) 0 1 /16 010 /64 11 /256 bit rate register (brr) h'fffffe01 8 bit item 7 6 5 4 3 2 1 0 bit name initial value 1 1 1 1 1 1 1 1 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 to 0 (bit rate setting) sets serial transmit/receive bit rate .com .com .com .com 4 .com u datasheet
575 sci serial control register (scr) h'fffffe02 8 bit item 7 6 5 4 3 2 1 0 bit name tie rie te re mpie teie cke1 cke0 initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 transmit interrupt enable (tie) 0 transmit-data-empty interrupt request (txi) is disabled (initial value) 1 transmit-data-empty interrupt request (txi) is enabled 6 receive interrupt enable (rie) 0 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are disabled (initial value) 1 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are enabled 5 transmit enable (te) 0 transmitter disabled (initial value) 1 transmitter enabled 4 receive enable (re) 0 receiver disabled (initial value) 1 receiver enabled 3 multiprocessor interrupt enable (mpie) 0 multiprocessor interrupts are disabled (nomal receive operation) (initial value). mpe is cleared to 0 when mpie is cleared to 0, or the multiprocessor bit (mpb) is set to 1 in receive data. 1 multiprocessor interrupts are enabled. receive-data-full interrupt requests (rxi), receive-error interrupt requests (eri), and setting of the rdrf, fer, and orer status flags in the serial status register (ssr) are disabled until the multiprocessor bit is set to 1. 2 transmit-end interrupt enable (teie) 0 transmit-end interrupt (tei) requests are disabled (initial value) 1 transmit-end interrupt (tei) requests are enabled 1, 0 clock enable 1 and 0 (cke1 and cke2) 0 0 asynchronous mode internal clock, sck pin used for input pin (input signal is ignored or output pin output level is undefined) clocked synchronous mode internal clock, sck pin used for synchronous clock output 0 1 asynchronous mode internal clock, sck pin used for clock output clocked synchronous mode internal clock, sck pin used for synchronous clock output 1 0 asynchronous mode internal clock, sck pin used for clock input clocked synchronous mode internal clock, sck pin used for synchronous clock input 1 1 asynchronous mode internal clock, sck pin used for clock input clocked synchronous mode internal clock, sck pin used for synchronous clock input .com .com .com .com 4 .com u datasheet
576 sci transmit data register (tdr) h'fffffe03 8 bit item 7 6 5 4 3 2 1 0 bit name initial value 1 1 1 1 1 1 1 1 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 to 0 (stores transmit data) stores data for serial transmission serial status register (ssr) h'fffffe04 8 bit item 7 6 5 4 3 2 1 0 bit name tdre rdrf orer fer per tend mpb mpbt initial value 1 0 0 0 0 1 0 0 r/w r(w)* r(w)* r(w)* r(w)* r(w)* r r r/w note: only 0 can be written to clear flags. bit bit name value description 7 transmit data register empty (tdre) 0 tdr contains valid transmit data tdre is cleared to 0 when software reads tdre after it has been set to 1, then writes 0 in tdre, or the dmac writes data in tdr. 1 tdr does not contain valid transmit data (initial value) tdre is set to 1 when the chip is reset or enters standby mode, the te bit in the serial control register (scr) is cleared to 0, or tdr contents are loaded into tsr, so new data can be written in tdr. 6 receive data register full (rdrf) 0 rdr does not contain valid received data (initial value) rdrf is cleared to 0 when the chip is reset or enters standby mode, software reads rdrf after it has been set to 1, then writes 0 in rdrf, or the dmac reads data from rdr. 1 rdr contains valid received data rdrf is set to 1 when serial data is received normally and transferred from rsr to rdr. .com .com .com .com 4 .com u datasheet
577 sci bit bit name value description 5 overrun error (orer) 0 receiving is in progress or has ended normally (initial value) orer is cleared to 0 when the chip is reset or enters standby mode, or software reads orer after it has been set to 1, then writes 0 in orer. 1 a receive overrun error occurred orer is set to 1 if reception of the next serial data ends when rdrf is set to 1. 4 framing error (fer) 0 receiving is in progress or has ended normally (initial value) fer is cleared to 0 when the chip is reset or enters standby mode, or software reads fer after it has been set to 1, then writes 0 in fer. 1 a receive framing error occurred fer is set to 1 if the stop bit at the end of receive data is checked and found to be 0. 3 parity error (per) 0 receiving is in progress or has ended nomally (initial value) per is cleared to 0 when the chip is reset or enters standby mode or software reads per after it has been set to 1, then writes 0 in per. 1 a receive parity error occurred per is set to 1 if the number of ls in receive data, including the parity bit, does not match the even or odd parity setting of the parity mode bit (o/ e ) in the serial mode register (smr). 2 transmit end (tend) 0 transmission is in progress tend is cleared to 0 when software reads tdrd after it has been set to 1, then writes 0 in tdre, or the dmac writes data in tdr. 1 end of transmission (initial value) tend is set to 1 when the chip is reset or enters standby mode, te is cleared to 0 in the serial control register (scr), or tdre is 1 when the last bit of a one-byte serial character is transmitted. 1 multiprocessor bit 0 multiprocessor bit value in receive data is 0 (initial value) (mpb) 1 multiprocessor bit value in receive data is 1 0 multiprocessor bit transfer (mpbt) 0 multiprocessor bit value in transmit data is 0 (initial value) 1 multiprocessor bit value in transmit data is 1 .com .com .com .com 4 .com u datasheet
578 sci receive data register (rdr) h'fffffe05 8 bit item 7 6 5 4 3 2 1 0 bit name initial value 0 0 0 0 0 0 0 0 r/w rr rr rr r r bit bit name description 7 to 0 (stores serial receive data) stores the received serial data .com .com .com .com 4 .com u datasheet
579 frt timer interrupt enable register (tier) h'fffffe10 8 bit item 7 6 5 4 3 2 1 0 name icie ociae ocibe ovie initial value 0 0 0 0 0 0 0 1 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 input capture interrupt enable (icie) 0 disables interrupt requests (ici) from icf (initial value) 1 enables interrupt requests (ici) from the icf 3 output compare interrupt a enable 0 disables interrupt requests (ocia) from ocfa (initial value) (ociae) 1 enables interrupt requests (ocia) from ocfa 2 output compare interrupt b enable 0 disables interrupt requests (ocib) from ocfb (initial value) (ocibe) 1 enables interrupt requests (ocib) from ocfb 1 timer overflow interrupt enable (ovie) 0 disables interrupt requests (ovi) from ovf (initial value) 1 enables interrupt requests (ovi) from ovf free-running timer control/status register (ftcsr) h'fffffe11 8 bit item 7 6 5 4 3 2 1 0 bit name icf ocfa ocfb ovf cclra initial value 0 0 0 0 0 0 0 0 r/w r/(w)* r/(w)* r/(w)* r/(w)* r/w note: for bits 7, and 3 to 1, the only value that can be written is 0 (to clear the flags) bit bit name value description 7 input capture flag (icf) 0 clear conditions: when icf = 1, icf is read and then 0 is written to it (initial value) 1 set conditions: when frc value is sent to icr by the input capture signal 3 output compare flag a (ocfa) 0 clear conditions: when ocfa = 1, ocfa is read and then 0 is written to it (initial value) 1 set conditions: when frc value becomes equal to ocra .com .com .com .com 4 .com u datasheet
580 frt bit bit name value description 2 output compare flag b (ocfb) 0 clear conditions: when ocfb = 1, ocfb is read and then 0 is written to it (initial value) 1 set conditions: when frc value becomes equal to ocrb 1 timer overflow flag (ovf) 0 clear conditions: when ovf = 1, ovf is read and then 0 is written to it (initial value) 1 set conditions: when frc value changes from h'ffff to h'0000 0 counter clear a 0 disables frc clear (initial value) (cclra) 1 clears frc on compare match a free-running counter (frc) h'fffffe12(frch) h'fffffe13(frcl) 16* note: access frch first and then frcl, two 8-bit units. bit item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 (count value) counts input clock pulses output compare register a/b* 1 (ocra/b) h'fffffe14(ocra/bh h'fffffe15(ocra/bl) 16* 2 notes: 1. switch registers with ocrs in tocr. 2. access ocra/bh first and then ocra/bl, in two 8-bit units. bit item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 (frc value comparison) sets ocfa when ocfa = frc sets ocfb when ocfb = ffc .com .com .com .com 4 .com u datasheet
581 frt timer control register (tcr) h'fffffe16 8 bit item 7 6 5 4 3 2 1 0 bit name iedga cks1 cks0 initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 input edge select 0 captures input on falling edge (initial value) (iedg) 1 captures input on rising edge 1, 0 clock selects 0 0 internal clock: count on /8 (initial value) (cks1 and cks0) 0 1 internal clock: count on /32 1 0 internal clock: count on /128 1 1 external clock: count on rising edge timer output compare control register (tocr) h'fffffe17 8 bit item 7 6 5 4 3 2 1 0 bit name ocrs olvla olvlb initial value 1 1 1 0 0 0 0 0 r/w r/w r/w r/w r/w r/w bit bit name value description 4 output compare register 0 selects ocra register (initial value) select (ocrs) 1 selects ocrb register 1 output level a (olvla) 0 outputs 0 on compare match a (initial value) 1 outputs 1 on compare match a 0 output level b (olvlb) 0 outputs 0 on compare match b (initial value) 1 outputs 1 on compare match b .com .com .com .com 4 .com u datasheet
582 frt input capture register (icr) h'fffffe18 (icrh) h'fffffe19 (icrl) 16* note: access icrh first and then icrl, in two 8-bit units. bit item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrrr bit bit name description 15 to 0 (stores frc value) stores frc value when an input capture signal occurs .com .com .com .com 4 .com u datasheet
583 intc interrupt priority level setting register a (ipra) h'fffffee2 8/16 bit item 15 14 13 12 11 10 9 8 76543210 bit name divu divu divu divu dmacdmac dmacdmac wdt wdt wdt wdt ip3 ip2 ip1 ip0 ip3 ip2 ip1 ip0 p3 ip2 ip1 ip0 initial value 0 0 0 0 0 0 0 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r bit bit name description 15 to 12 division unit (divu) interrupt priority level (divuip3 divuip0) these bits set the division unit (divu) interrupt priority level 11 to 8 dma controller interrupt priority level (dmacip3 dmacip0) these bits set the dma controller (dmac) interrupt priority level 7 to 4 watchdog timer (wdt) interrupt priority level (wdtip3 wdtip0) these bits set the watchdog timer (wdt) interrupt priority level and bus state controller (bsc) interrupt priority level interrupt priority level setting register b (iprb) h'fffffe60 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name sci sci sci sci frt frt frt frt ip3 ip2 ip1 ip0 ip3 ip2 ip1 ip0 initial value 0000 0000 0000 0000 r/w r/wr/wr/wr/wr/wr/wr/wr/wrrrr rrrr bit bit name description 15 to 12 serial communication interface (sci) interrupt priority level (sciip3 sciip0) these bits set the serial communication interface (sci) interrupt priority level 11 to 8 free-running timer (frt) interrupt priority level (frtip3 frtip0) these bits set the free-running timer (frt) interrupt priority level .com .com .com .com 4 .com u datasheet
584 intc vector number setting register a (vcra) h'fffffe62 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name ser ser ser ser ser ser ser srx srx srx srx srx srx srx v6 v5 v4 v3 v2 v1 v0 v6 v5 v4 v3 v2 v1 v0 initial value 0000 0000 0000 0000 r/w r r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w bit bit name description 14 to 8 serial communication interface (sci) receive-error interrupt vector number (serv6 serv0) these bits set the vector number for the serial communication interface (sci) receive-error interrupt (eri) 6 to 0 serial communication interface (sci) receive-data-full interrupt vector number (srxv6 srxv0) these bits set the vector number for the serial communication interface (sci) receive-data-full interrupt (rxi) vector number setting register b (vcrb) h'fffffe64 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name stx stx stx stx stx stx stx ste ste ste ste ste ste ste v6 v5 v4 v3 v2 v1 v0 v6 v5 v4 v3 v2 v1 v0 initial value 0000 0000 0000 0000 r/w r r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w bit bit name description 14 to 8 serial communication interface (sci) transmit-data-empty interrupt vector number (stxv6 stxv0) these bits set the vector number for the serial communication interface (sci) transmit-data-empty interrupt (txi) 6 to 0 serial communication interface (sci) transmit-end interrupt vector number (stev6 stev0) these bits set the vector number for the serial communication interface (sci) transmit-end interrupt (tei) .com .com .com .com 4 .com u datasheet
585 intc vector number setting register c (vcrc) h'fffffe66 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name fic fic fic fic fic fic fic foc foc foc foc foc foc foc v6 v5 v4 v3 v2 v1 v0 v6 v5 v4 v3 v2 v1 v0 initial value 0000 0000 0000 0000 r/w r r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w bit bit name description 14 to 8 free-running timer (frt) input- capture interrupt vector number (ficv6 ficv0) these bits set the vector number for the free-running timer (frt) input-capture interrupt (ici) 6 to 0 free-running timer (frt) output- compare interrupt vector number (focv6 focv0) these bits set the vector number for the free-running timer (frt) output-compare interrupt (oci) vector number setting register d (vcrd) h'fffffe68 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name fov fov fov fov fov fov fov v6 v5 v4 v3 v2 v1 v0 initial value 0000 0000 0000 0000 r/w rr/wr/wr/wr/wr/wr/wr/wrrrr rrrr bit bit name description 14 to 8 free-running timer (frt) overflow interrupt vector number (fovv6 fovv0) these bit set the vector number for the free-running timer(frt) overflow interrupt (ovi) .com .com .com .com 4 .com u datasheet
586 intc vector number setting register wdt (vcrwdt) h'fffffee4 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name wit wit wit wit wit wit wit bcm bcm bcm bcm bcm bcm bcm v6 v5 v4 v3 v2 v1 v0 v6 v5 v4 v3 v2 v1 v0 initial value 0000 0000 0000 0000 r/w r r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w bit bit name description 14 to 8 watchdog timer (wdt) interval interupt vector number (witv6 witv0) these bits set the vector number for the interval interrupt (iti) of the watchdog timer (wdt) 6 to 0 bus state controller (bsc) compare match interrupt vector number (bcmv6 bcmv0) these bits set the vector number for the compare match interrupt (cmi) of the bus state controller (bsc) vector number setting register div (vcrdiv) h'ffffff0c 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrrr item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 (vector number setting) these bits set the vector number for the interrupt when caused by overflow or underflow of the division unit .com .com .com .com 4 .com u datasheet
587 intc vector number setting registers dma0 and dma1 (vcrdma0, vcrdma1) h'ffffffa0 (channel 0) h'ffffffa8 (channel 1) 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrrr item 15 14 13 12 11 10 9 8 7654 3210 bit name vc7 vc6 vc5 vc4 vc3 vc2 vc1 vc0 initial value 0000 0000 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w bit bit name description 7 to 0 vector number bits (vc7 vc0) these bits set the vector number at the end of dma transfer interrupt control register (icr) h'fffffee0 8/16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name vec nmil nmie md initial value 0/1* 0 0 0 0 0 0 0 r/w rrrr rrrr/w rrrr rrrr/w note: when nmi input is high: 1; when nmi input is low: 0 bit bit name value description 15 nmi input level (nmil) 0 nmi input level is low 1 nmi input level is high 8 nmi edge select (nmie) 0 interrupt request is detected on falling edge of nmi input (initial value) 1 interrupt request is detected on rising edge of nmi input 1 rl interrupt vector 0 auto-vector mode, automatically set internall (initial value) mode select (vecmd) 1 external vector mode, external input .com .com .com .com 4 .com u datasheet
588 wdt watchdog timer control/status register (wtcsr) h'fffffe80 8 (read) 16 (write) bit item 7 6 5 4 3 2 1 0 bit name ovf wt/ it tme cks2 cks1 cks0 initial value 0 0 0 1 1 0 0 0 r/w r/(w)* r/w r/w r/w r/w r/w note: wtcsr differs from other registers in being more difficult to write. see section 12.2.4, register access, for details. bit bit name value description 7 overflow flag (ovf) 0 no overflow of wtcnt in interval timer mode (initial value) cleared by reading ovf, then writing 0 in ovf 1 wtcnt overflow in interval timer mode 6 timer mode select (wt/ it ) 0 interval timer mode: interval timer interrupt (iti) request to the cpu when wtcnt overflows (initial value) 1 watchdog timer mode: wdtovf signal is output externally when wtcnt overflows 5 timer enable (tme) 0 timer disabled: wtcnt is initialized to h'00 and count- up stops (initial value) 1 timer enabled: wtcnt starts counting a wdtovf signal or interrupt is generated when wtcnt overflows 2 to 0 clock select 2 to 0 (cks2 to cks0) cks2 cks1 cks0 clock source overflow interval ( = 28.7 mhz) 00 0 /2 (initial value) 17.8 s 00 1 /64 570.8 s 01 0 /128 1.1ms 01 1 /256 2.2ms 10 0 /512 4.5ms 10 1 /1024 9.1ms 11 0 /4096 35.5ms 11 1 /8192 73.0ms .com .com .com .com 4 .com u datasheet
589 wdt watchdog timer counter (wtcnt) h'fffffe80 (write) h'fffffe81 (read) 16 (write) 8 (read) bit item 7 6 5 4 3 2 1 0 bit name initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 to 0 (count value) input clock count value reset control/status register (rstcsr) h'fffffe82 (write) h'fffffe83 (read) 16 (write) 8 (read) bit item 7 6 5 4 3 2 1 0 bit name wovf rste rsts initial value 0 0 0 1 1 1 1 1 r/w r/(w)* r/w r/w note: only 0 can be written in bit 7 to clear the flag. bit bit name value description 7 watchdog timer overflow flag (wovf) 0 no wtcnt overflow in watchdog timer mode (initial value) cleared when software reads wovf, then writes 0 in wovf 1 set by wtcnt overflow in watchdog timer mode 6 reset enable (rste) 0 no internal reset when wtcnt overflows (initial value) 1 internal reset when wtcnt overflows 5 reset select (rsts) 0 power-on reset (initial value) 1 manual reset .com .com .com .com 4 .com u datasheet
590 divu divisor register (dvsr) h'fffffe00 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 0 (written with divisor) used to write the divisor for the operation dividend register l for 32-bit division (dvdnt) h'fffffe04 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 0 (dividend setting) set with the 32-bit dividend used for 32-bit/32-bit division operations .com .com .com .com 4 .com u datasheet
591 divu division control register (dvcr) h'ffffff08 16/32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrrr item 15 14 13 12 11 10 9 8 7654 3210 bit name ovf ie ovf initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrr/wr/w bit bit name value description 1 ovf interrupt enable (ovfie) 0 disables interrupt request (ovfi) caused by ovf (initial value) 1 enables interrupt request (ovfi) caused by ovf 0 overflow flag (ovf) 0 no overflow has occurred (initial value) 1 overflow has occurred dividend register h (dvdnth) h'ffffff10 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 1 (dividend setting) set with the upper 32 bits of the dividend used for 64-bit/32- bit division operations .com .com .com .com 4 .com u datasheet
592 divu dividend regiater l (dvdntl) h'ffffff14 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 1 (dividend setting) set with the lower 32 bits of the dividend used for 64-bit/32- bit division operations .com .com .com .com 4 .com u datasheet
593 ubc break address register ah (barah) h'ffffff40 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name baa 31 baa 30 baa 29 baa 28 baa 27 baa 26 baa 25 baa 24 baa 23 baa 22 baa 21 baa 20 baa 19 baa 18 baa 17 baa 16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break address baa31 baa16 these bits specify the upper bits (bit 31 to bit 16) of the channel a break condition address break address register al (baral) h'ffffff42 16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name baa 15 baa 14 baa 13 baa 12 baa 11 baa 10 baa 9 baa 8 baa 7 baa 6 baa 5 baa 4 baa 3 baa 2 baa 1 baa 0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break address baa15 baa0 these bits specify the lower bits (bit 15 to bit 0) of the channel a break condition address .com .com .com .com 4 .com u datasheet
594 ubc break address mask register ah (bamrah) h'ffffff44 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bam a31 bam a30 bam a29 bam a28 bam a27 bam a26 bam a25 bam a24 bam a23 bam a22 bam a21 bam a20 bam a19 bam a18 bam a17 bam a16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break address bama31 bama16 0 channel a break address baan is included in the break conditions (initial value) 1 channel a break address baan is not included in the break conditions n = 31 to 16 break address mask register al (bamral) h'ffffff46 16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bam a15 bam a14 bam a13 bam a12 bam a11 bam a10 bam a9 bam a8 bam a7 bam a6 bam a5 bam a4 bam a3 bam a2 bam a1 bam a0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break address bama15 bama0 0 channel a break address baan is included in the break conditions (initial value) 1 channel a break address baan is not included in the break conditions n = 15 to 0 .com .com .com .com 4 .com u datasheet
595 ubc break bus cycle register a (bbra) h'ffffff48 16/32 bit item 15 14 13 12 11 10 9 8 7654 32 10 bit name cpa 1 cpa 0 ida1 ida0 rwa 1 rw a0 sza 1 sza 0 initial value 0000 0000 0000 00 00 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w bit bit name value description 7, 6 cpu cycle/peripheral cycle select a 0 0 no channel a user break interrupt generated (initial value) (cpa1, cpa0) 0 1 break only on cpu cycles 1 0 break only on peripheral cycles 1 1 break on both cpu and peripheral cycles 5, 4 instruction fetch/data access select a 0 0 no channel a user break interrupt generated (initial value) (ida1, ida0) 0 1 break only on instruction fetch cycles 1 0 break only on data access cycles 1 1 break on both instruction fetch and data access cycles 3, 2 read/write select a (rwa1, rwa0) 0 0 no channel a user break interrupt generated (initial value) 0 1 break only on read cycles 1 0 break only on write cycles 1 1 break on both read and write cycles 1, 0 operand size select a 0 0 operand size is not a break condition (initial value) (sza1, sza0) 0 1 break on byte access 1 0 break on word access 1 1 break on longword access break address register bh (barbh) h'ffffff60 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bab 31 bab 30 bab 29 bab 28 bab 27 bab 26 bab 25 bab 24 bab 23 bab 22 bab 21 bab 20 bab 19 bab 18 bab 17 bab 16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break address bab31 bab16 these bits specify the upper bits (bit 31 to bit 16) of the channel b break condition address .com .com .com .com 4 .com u datasheet
596 ubc break address register bl (barbl) h'ffffff62 16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bab 15 bab 14 bab 13 bab 12 bab 11 bab 10 bab 9 bab 8 bab 7 bab 6 bab 5 bab 4 bab 3 bab 2 bab 1 bab 0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break address bab15 bab0 these bits specify the lower bits (bit 15 to bit 0) of the channel b break condition address break address mask register bh (bamrbh) h'ffffff64 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bam b31 bam b30 bam b29 bam b28 bam b27 bam b26 bam b25 bam b24 bam b23 bam b22 bam b21 bam b20 bam b19 bam b18 bam b17 bam b16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break address mask bamb31 bamb16 0 channel b break address babn is included in the break conditions (initial value) 1 channel b break address babn is not included in the break conditions n = 31 to 16 .com .com .com .com 4 .com u datasheet
597 ubc break address mask register bl (bamrbl) h'ffffff66 16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bam b15 bam b14 bam b13 bam b12 bam b11 bam b10 bam b9 bam b8 bam b7 bam b6 bam b5 bam b4 bam b3 bam b2 bam b1 bam b0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break address mask bamb15 bamb0 0 channel b break address babn is included in the break conditions (initial value) 1 channel b break address babn is not included in the break conditions n = 15 to 0 break data register bh (bdrbh) h'ffffff70 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bdb 31 bdb 30 bdb 29 bdb 28 bdb 27 bdb 26 bdb 25 bdb 24 bdb 23 bdb 22 bdb 21 bdb 20 bdb 19 bdb 18 bdb 17 bdb 16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break data bdb31 bdb16 these bits specify the upper bits (bit 31 to bit 16) of the channel b break condition data .com .com .com .com 4 .com u datasheet
598 ubc break data register bl (bdrbl) h'ffffff72 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bdb 15 bdb 14 bdb 13 bdb 12 bdb 11 bdb 10 bdb 9 bdb 8 bdb 7 bdb 6 bdb 5 bdb 4 bdb 3 bdb 2 bdb 1 bdb 0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 to 0 break data bdb15 bdb0 these bits specify the lower bits (bit 15 to bit 0) of the channel b break condition data break data mask register bh (bdmrbh) h'ffffff74 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bdm b31 bdm b30 bdm b29 bdm b28 bdm b27 bdm b26 bdm b25 bdm b24 bdm b23 bdm b22 bdm b21 bdm b20 bdm b19 bdm b18 bdm b17 bdm b16 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break data mask bdmb31 bdmb16 0 channel b break address bdbn is included in the break conditions (initial value) 1 channel b break address bdbn is masked and therefore not included in the break conditions n = 31 to 16 .com .com .com .com 4 .com u datasheet
599 ubc break data mask register bl (bdmrbl) h'ffffff76 16 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name bdm b15 bdm b14 bdm b13 bdm b12 bdm b11 bdm b10 bdm b9 bdm b8 bdm b7 bdm b6 bdm b5 bdm b4 bdm b3 bdm b2 bdm b1 bdm b0 initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 0 break data mask bdmb15 bdmb0 0 channel b break address bdbn is included in the break conditions (initial value) 1 channel b break address bdbn is masked and therefore not included in the break conditions n = 15 to 0 .com .com .com .com 4 .com u datasheet
600 ubc break bus cycle register b (bbrb) h'ffffff68 16/32 bit item 15 14 13 12 11 10 9 8 7654 32 10 bit name cpb 1 cpb 0 idb 1 idb 0 rwb 1 rwb 0 szb 1 szb 0 initial value 0000 0000 0000 00 00 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w bit bit name value description 7, 6 cpu cycle/peripheral cycle select b 0 0 no channel b user break interrupt generated (initial value) (cpb1, cpb0) 0 1 break only on cpu cycles 1 0 break only on peripheral cycles 1 1 break on both cpu and peripheral cycles 5, 4 instruction fetch/data access select b 0 0 no channel b user break interrupt generated (initial value) (idb1, idb0) 0 1 break only on instruction fetch cyclcs 1 0 break only on data access cycles 1 1 break on both instruction fetch and data access cycles 3, 2 read/write select b (rwb1, rwb0) 0 0 no channel b user break interrupt generated (initial value) 0 1 break only on read cycles 1 0 break only on write cycles 1 1 break on both read and write cycles 1, 0 operand size select b 0 0 operand size is not a break condition (initial value) (szb1, szb0) 0 1 break on byte access 1 0 break on word access 1 1 break on longword access .com .com .com .com 4 .com u datasheet
601 ubc break control register (brcr) h'ffffff78 16/32 bit item 15 14 13 12 11 10 9 8 7654 32 10 bit name cmf cmf cmf cmf ca pa ebbe umd pcba cb pb seq dbeb pcbb initial value 0000 0000 0000 00 00 r/w r/w r/w r/w r/w r r/w r r r/w r/w r r/w r/w r/w r r bit bit name value description 15 cpu condition match flag a (cmfca) 0 channel a cpu cycle conditions do not match, no user break interrupt generated (initial value) 1 channel a cpu cycle conditions have matched, user break interrupt generated 14 peripheral condition match flag a (cmfpa) 0 channel a peripheral cycle conditions do not match, no user break interrupt generated (initial value) 1 channel a peripheral cycle conditions have matched, user break interrupt generated 13 external bus break enable (ebbe) 0 chip-external bus cycle not included in break conditions (initial value) 1 chip-external bus cycle included in break conditions 12 ubc mode (umd) 0 compatible mode for sh7000-series ubcs (initial value) 1 sh7604 mode 10 pc break select a (pcba) 0 places the channel a instruction fetch cycle break before instruction execution (initial value) 1 places the channel a instruction fetch cycle break after instruction execution 7 cpu condition match flag b (cmfcb) 1 channel b cpu cycle conditions do not match, no user break interrupt generated (initial value) 0 channel b cpu cycle conditions have matched, user break interrupt generated 6 peripheral condition match flag b (cmfpb) 0 channel b peripheral cycle conditions do not match, no user break interrupt generated (initial value) 1 channel b peripheral cycle conditions have matched, user break interrupt generated 4 sequence condition select (seq) 0 compare channel a and b conditions independently (initial value) 1 compare channel a and b conditions sequentially (channel a, then channel b) 3 data break enable b (dbeb) 0 do not include data bus conditions in the channel b conditions (initial value) 1 include data bus conditions in the channel b conditions 2 instruction break select b (pcbb) 0 places the channel b instruction fetch cycle break before instruction execution (initial value) 1 places the channel b instruction fetch cycle break after instruction execution .com .com .com .com 4 .com u datasheet
602 dmac dma source address registers 0 and 1 (sar0 and sar1) h'ffffff80 (channel 0) h'ffffff90 (channel 1) 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 0 (transfer source address specification) these bits specify the dma transfer source address dma destination address registers 0 and 1 (dar0 and dar1) h'ffffff84 (channel 0) h'ffffff94 (channel 1) 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 to 0 (transfer destination address specification) these bits specify the dma transfer destination address .com .com .com .com 4 .com u datasheet
603 dmac dma transfer count registers 0 and 1 (tcr0 and tcr1) h'ffffff88 (channel 0) h'ffffff98 (channel 1) 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 23 to 0 (transfer count specification) specifies the dma transfer count (during a dma transfer, these bits indicate the remaining transfer count) dma channel control registers 0, 1 (chcr0, chcr1) h'ffffff8c (channel 0) h'ffffff9c (channel 1) 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrrr item 15 14 13 12 11 10 9 8 7654 3210 bit name dm1 dm0 sm1 sm0 ts1 ts0 ar am al ds dl tb ta ie te de initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/ (w)* r/w note: only 0 can be written, after reading 1, to clear the flag. bit bit name value description 14, 15 destination address 0 0 fixed destination address (initial value) mode bits 1, 0 (dm1, dm0) 0 1 destination address is incremented (+1 for byte transfer size, +2 for word transfer size, +4 for longword transfer size, and +16 for 16-byte transfer size) 1 0 destination address is decremented ( 1 for byte transfer size, 2 for word transfer size, 4 for longword transfer size, and 16 for 16-byte transfer size) 1 1 reserved (setting prohibited) .com .com .com .com 4 .com u datasheet
604 dmac bit bit name value description 13, 12 source address mode bits 1, 0 (sm1, sm0) 0 0 fixed source address (+16 for 16-byte transfer size) (initial value) 0 1 source address is incremented (+1 for byte transfer size, +2 for word transfer size, +4 for longword transfer size, and +16 for 16-byte transfer size) 1 0 source address is decremented ( 1 for byte transfer size, 2 for word transfer size, 4 for longword transfer size, and +16 for 16-byte transfer size) 1 1 reserved (setting prohibited) 11, 10 transfer size bits 1, 0 0 byte unit (initial value) (ts1, ts0) 0 word (2-byte) unit 1 longword (4-byte) unit 1 16-byte unit (4 longword transfers) 9 auto-request mode bit 0 module request mode (initial value) (ar) 1 auto-request mode 8 acknowledge/transfer mode bit (am) 0 dack output in read cycle/transfer from memory to device (initial value) 1 dack output in write cycle/transfer from device to memory 7 acknowledge level bit 0 dack is an active-low signal (initial value) (al) 1 dack is an active-high signal 6 dreq select bit (ds) 0 detected by level (initial value) 1 detected by edge 5 dreq level bit (dl) 0 when ds is 0, dreq is detected by low level; when ds is 1, dreq is detected by fall (initial value) 1 when ds is 0, dreq is detected by high level; when ds is 1, dreq is detected by rise 4 transfer bus mode bit (tb) 0 cycle-steal mode 1 burst mode 3 transfer address mode bit (ta) 0 dnal address mode 1 single address mode 2 interrupt enable bit (ie) 0 interrupt disabled (initial value) 1 interrupt enabled 1 transfer-end flag bit (te) 0 dma has not ended or was aborted (initial value) cleared by reading 1 from the te bit and then writing 0 1 dma has ended nomally (by tcr = 0) 0 dma enable bit (de) 0 dma transfer disabled (initial value) 1 dma transfer enabled .com .com .com .com 4 .com u datasheet
605 dmac dma request/response selection control registers 0 and 1 (drcr0, drcr1) h'fffffe71 (channel 0) h'fffffe72 (channel 1) 8 bit item 7 6 5 4 3 2 1 0 bit name rs1 rs0 initial value 0 0 0 0 0 0 0 0 r/w r r r r r r r/w r/w bit bit name value description 1, 0 resource select bits 0 0 dreq (external request) (initial value) 1, 0 (rs1, rs0) 0 1 rxi (receive-data-full interrupt transfer request of the on- chip serial communication interface (sci)) 1 0 txi (transmit-data-full interrupt transfer request of the on- chip sci) 1 1 reserved (setting prohibited) .com .com .com .com 4 .com u datasheet
606 dmac dma operation register (dmaor) h'ffffffb0 32 bit item 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrr rrr item 15 14 13 12 11 10 9 8 7654 3210 bit name pr ae nmif dme initial value 0000 0000 0000 0000 r/w rrrr rrrr rrrrr/wr/ (w)* r/ (w)* r/w note: only 0 can be written, to clear the flag. bit bit name value description 3 priority mode bit (pr) 0 fixed priority (ch 0 > ch 1) (initial value) 1 round-robin mode (high priority switches to low after each transfer) (the priority for the first dma transfer after a reset is ch 1 > ch 0) 2 address error flag bit 0 no dmac address error (initial value) (ae) 1 address error by dmac 1 nmi flag bit (nmif) 0 no nmif interrupt (initial value) to clear the nmif bit, read 1 from it and then write 0 1 nmif has occurred 0 dma master enable bit 0 dma transfers disabled on all channels (initial value) (dme) 1 dma transfers enabled on all channels .com .com .com .com 4 .com u datasheet
607 bsc bus control register 1 (bcr1) h'ffffffe0 16/32 bit item 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit name mas end bst pshr ahlw ahlw a1lw a1lw a0lw a0lw dram dram dram ter ian rom 1 0 1 0 1 0 210 initial value 00000 1 111 1100 0 0 r/w r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w bit bit name value description 15 bus arbitration 0 master mode (master) 1 slave mode 12 endian specification for 0 big-endian, as in other areas (initial value) area 2 (endian) 1 little-endian 11 area 0 burst rom 0 area 0 is accessed normally (initial value) enable (bstrom) 1 area 0 is accessed as burst rom 10 partial space share 0 total master mode when md5 = 0 (initial mode) specification (pshr) 1 partial-share master mode when md5 = 0 9, 8 long wait specification 0 0 3 waits (initial value) for areas 2 and 3 0 1 4 waits (ahlw1, ahlw0) 1 0 5 waits 1 1 6 waits 7, 6 long wait specification 0 0 3 waits (initial value) for area 1 (a1lw1, 0 1 4 waits a1lw0) 1 0 5 waits 1 1 6 waits 5, 4 long wait specification 0 0 3 waits (initial value) for area 0 (a0lw1, 0 1 4 waits a0lw0) 1 0 5 waits 1 1 6 waits 2 to 0 enable for dram and 0 0 0 areas 2 and 3 are ordinary spaces (initial value) other memory (dram2 dram0) 0 0 1 area 2 is ordinary space; area 3 is synchronous dram space 0 1 0 area 2 is ordinary space; area 3 is dram space 0 1 1 area 2 is ordinary space; area 3 is pseudo-sram space 1 0 0 area 2 is synchronous dram space; area 3 is ordinary space 1 0 1 areas 2 and 3 are synchronous dram spaces 1 1 0 reserved (setting prohibited) 1 1 1 reserved (setting prohibited) .com .com .com .com 4 .com u datasheet
608 bsc bus control register 2 (bcr2) h'ffffffe4 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name a3 a3 a2 a2 a1 a1 sz1 sz0 sz1 sz0 sz1 sz0 initial value 0000 0000 1111 1100 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wrr bit bit name value description 7, 6 bus size specification for area 3 (a3sz1 0 0 reserved (setting prohibited) a3sz0)(valid only 0 1 byte (8-bit) size when setting ordinary 1 0 word (16-bit) size space) 1 1 longword (32-bit) size (initial value) 5, 4 bus size specification for area 2 (a2sz1 0 0 reserved (setting prohibited) a2sz0) (valid only 0 1 byte (8-bit) size when setting ordinary 1 0 word (16-bit) size space) 1 1 longword (32-bit) size (initial value) 3, 2 bus size specification 0 0 reserved (setting prohibited) for area 1 (a1sz1 0 1 byte (8-bit) size a1sz0) 1 0 word (16-bit) size 1 1 longword (32-bit) size (initial value) wait control register (wcr) h'ffffffe8 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name iw31 iw30 iw21 iw20 iw11 iw10 iw01 iw00 w31 w30 w21 w20 w11 w10 w01 w00 initial value 1010 1010 1111 1111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 to 8 idles between cycles for areas 3 to 0 (iw31 iw00) iw31 iw21 iw11 iw01 iw30 iw20 iw10 iw00 0 0 no idle cycle 0 1 one idle cycle inserted 1 0 two idle cycles inserted (initial value) 1 1 reserved (setting prohibited) .com .com .com .com 4 .com u datasheet
609 bsc bit bit name value description 7 to 0 wait control of areas 3 during basic cycle to 0 (w31 w00) w31 w21 w11 w01 w30 w20 w10 w00 0 0 external wait input disabled without waits 0 1 external wait input enabled with one wait 1 0 external wait input enabled with two waits 1 1 complies with the long wait specification of bus control register 1 (bcr1) external wait input is enabled (initial value) when area 3 is dram w31 w30 0 0 1 cas assert cycle 0 1 2 cas assert cycles 1 0 3 cas assert cycles 1 1 reserved (setting prohibited) when area 2 or 3 is synchronous dram w31 w21 w30 w20 0 0 1 cas latency cycle 0 1 2 cas latency cycles 1 0 3 cas latency cycles 1 1 4 cas latency cycles (initial value) when area 3 is pseudo-sram w31 w30 0 0 2 cycles from bs signal assertion to end of cycle 0 1 3 cycles from bs signal assertion to end of cycle 1 0 4 cycles from bs signal assertion to end of cycle 1 1 reserved (setting prohibited) individual memory control register (mcr) h'ffffffec 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name tras tras trp rcd trwl 1 0 be rasd amx2 sz amx1 amx0 rfsh rmd initial value 0000 0000 0000 0000 r/w r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r r .com .com .com .com 4 .com u datasheet
610 bsc bit bit name value description 15 ras precharge time 0 1 cycle (initial value) (trp) 1 2 cycles 14 ras-cas delay (rcd) 0 1 cycle (initial value) 1 2 cycles 13 write-precharge delay 0 1 cycle (initial value) (trwl) 1 2 cycles 12, 11 cas-before-ras 0 0 2 cycles (initial value) refresh ras assert time 0 1 3 cycles (tras1, tras0) 1 0 4 cycles 1 1 reserved (setting prohibited) 10 burst enable (be) 0 burst disabled (initial value) 1 high-speed page mode during dram interface is enabled. data is continuously transferred in static column mode during pseudo-sram interfacing. during synchronous dram access, burst is always enabled regardless of this bit. 9 bank active mode (rasd) 0 for synchronous dram, read or write is performed using auto-precharge mode. the next access always starts with a bank active command. 1 for synchronous dram, access ends with bank active status. this is only valid for area 3. when area 2 is synchronous dram, the mode is always auto-precharge. .com .com .com .com 4 .com u datasheet
611 bsc bit bit name value description 7, 5, 4 address multiplex for dram interface (amx2 amx0) 0 0 0 8-bit column address dram (initial value) 0 0 1 9-bit column address dram 0 1 0 10-bit column address dram 0 1 1 11-bit column address dram 1 0 0 reserved (setting prohibited) 1 0 1 reserved (setting prohibited) 1 1 0 reserved (setting prohibited) 1 1 1 reserved (setting prohibited) for synchronous dram interface 0 0 0 16-mbit dram (1m 16 bits) (initial value) 0 0 1 16-mbit dram (2m 8 bits) 0 1 0 16-mbit dram (4m 4 bits) 0 1 1 4-mbit dram (256k 16 bits) 1 0 0 reserved (setting prohibited) 1 0 1 reserved (setting prohibited) 1 1 0 reserved (setting prohibited) 1 1 1 2-mbit dram (128k 16 bits) 6 memory data size (sz) 0 word (initial value) 1 longword 3 refresh control (rfsh) 0 no refresh (initial value) 1 refresh 2 refresh mode (rmode) 0 normal refresh (initial value) 1 self-refresh .com .com .com .com 4 .com u datasheet
612 bsc refresh timer control/status register (rtcsr) h'fffffff0 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name cmf cmie cks2 cks1 cks0 initial value 0000 0000 0000 0000 r/w rrrr rrrrr/wr/wr/wr/wr/wrrr bit bit name value description 7 compare match flag (cmf) rtcnt and rtcor match clear condition: after rtcsr is read when cmf is 1, 0 is written in cmf 6 compare match interrupt enable (cmie) 0 disables interrupt request caused by cmf (initial value) 1 enables interrupt request caused by cmf 5 to 3 clock select bits 0 0 0 disables count up (initial value) (cks2 cks0) 0 0 1 clk/4 0 1 0 clk/16 0 1 1 clk/64 1 0 0 clk/256 1 0 1 clk/1024 1 1 0 clk/2048 1 1 1 clk/4096 refresh timer counter (rtcnt) h'fffffff4 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w bit bit name description 7 to 0 (count value) input clock count value refresh time constant register (rtcor) h'fffffff8 16/32 bit item 15 14 13 12 11 10 9 8 7654 3210 bit name initial value 0000 0000 0000 0000 r/w rrrr rrrrr/wr/wr/wr/wr/wr/wr/wr/w bit bit name description 7 to 0 (timer constant) sets the refresh cycle .com .com .com .com 4 .com u datasheet
613 cache cache control register (ccr) h'fffffe92 8 bit item 7 6 5 4 3 2 1 0 bit name w1 w0 cp tw od id ce initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7, 6 way specification 0 0 way 0 (initial value) (w1, w0) 0 1 way 1 1 0 way 2 1 1 way 3 4 cache purge (cp) 0 normal operation (initial value) 1 cache purge 3 two-way mode (tw) 0 four-way mode (initial value) 1 two-way mode 2 data replacement 0 normal operation (initial value) disable (od) 1 data not replaced even when cache miss occurs in data access 1 instruction replacement 0 normal operation (initial value) disable (id) 1 data not replaced even when cache miss occurs in instruction fetch 0 cache enable (ce) 0 cache disabled (initial value) 1 cache enabled .com .com .com .com 4 .com u datasheet
614 power-down standby control register (sbycr) h'fffffe91 8 bit item 7 6 5 4 3 2 1 0 bit name sby hiz mstp4 mstp3 mstp2 mstp1 mstp0 initial value 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 standby (sby) 0 executing sleep instruction puts the chip into sleep mode (initial value) 1 executing sleep instruction puts the chip into standby mode 6 port high impedance 0 pin states held in standby mode (initial value) (hiz) 1 pins at high impedance in standby mode 4 module stop 4 (mstp4) 0 dmac running (initial value) 1 clock supply to dmac halted 3 module stop 3 (mstp3) 0 mult running (initial value) 1 clock supply to mult halted 2 module stop 2 (mstp2) 0 divu running (initial value) 1 clock supply to divu halted 1 module stop 1 (mstp1) 0 frt running (initial value) 1 clock supply to frt halted 0 module stop 0 (mstp0) 0 sci running (initial value) 1 clock supply to sci halted .com .com .com .com 4 .com u datasheet
615 appendix c external dimensions figure c.1 shows the external dimensions of the sh7604 (fp144j). hitachi code jedec eiaj mass (reference value) fp-144j conforms 2.4 g *dimension including the plating thickness base material dimension 0.10 m 20 22.0 0.2 73 36 144 0.5 0.10 3.05 max 0 8 22.0 0.2 108 72 37 109 1 0.17 0.05 2.70 0.22 0.05 0.5 0.1 1.0 0.10 +0.15 0.10 1.25 0.20 0.04 0.15 0.04 * * as of january, 2001 unit: mm figure c.1 external dimensions .com .com .com .com 4 .com u datasheet
616 figure c.2 shows the external dimensions of the sh7604 (tbp-176). hitachi code jedec eiaj mass (reference value) tbp-176 0.32 g 13.0 0.4 0.05 0.2 0.1 c 0.08 ab 12.6 0.1 13.0 c c a 176 0.5 0.05 details of the part a m 1.2 max 0.3 c a 0.3 c b 0.8 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0.8 0.9 0.9 b c a a b c d e f g h j k l m n p r 0.20 4 unit: mm figure c.2 external dimensions .com .com .com .com 4 .com u datasheet
sh7604 hardware manual publication date: 1st edition, march 1995 4th edition, september 2001 published by: customer service division hitachi, ltd. edited by: technical documentation center hitachi kodaira semiconductor co., ltd. copyright ? hitachi, ltd., 1995. all rights reserved. printed in japan. .com .com .com 4 .com u datasheet


▲Up To Search▲   

 
Price & Availability of HD6417604

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X